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!

Urgent Group by Having Clause Fails in Oracle and Works in Sybase

296002Jan 22 2003 — edited Jan 23 2003
Hello EveryBody I need to select curve data of curve whose date is maximum in that curve so say if i ahve

so if records are
curveid curvename curvedate
1001 test1 12/12/1003
1001 test1 12/13/1003
1002 test2 12/12/2002
1002 test2 12/12/2004

I have query which run well in sybase but oracle screw up...My logic say having clause is use to filter the records of group so it should have worked in oracle.....

Here is query
select curveid,curvename from curve group by curveid having curvedate =max(curve_date)

This give "not a Group by " error in oracle....It work well in sybase...

:
ORA-00979: not a GROUP BY expression


I have query which use subquery to select these records but i don't want that to use that query



Please help



Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 20 2003
Added on Jan 22 2003
12 comments
416 views