Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DISTINCT with ORDER BY

EV259Nov 25 2014 — edited Nov 25 2014

All,

Facing a problem with the below query... 'DISTINCT with Order By Clause'.

Its working when we take the same column for distinct and order by then the query is working. But, in my case..there is a join b/w couple of tables.. and the distinct is for one column and the order by is for different table with different column.

Please suggest me a solution for this below query as the column in the distinct and column used for order by are different.

SELECT DISTINCT gl_cc.segment2

           FROM gl_code_combinations gl_cc,

                per_all_people_f req_emp,

                per_all_assignments_f req_emp_assign

          WHERE req_emp.person_id = req_emp_assign.person_id

            AND gl_cc.code_combination_id =

                                           req_emp_assign.default_code_comb_id

            AND req_emp.full_name = 'xyz'

       ORDER BY req_emp_assign.last_update_date DESC

Thanks

This post has been answered by Deepak Mahto on Nov 25 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 23 2014
Added on Nov 25 2014
2 comments
374 views