Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Select Family, First (Name) from ... group by Family
Uhh! Cool guy :)
I agree with Jonathan Lewis that there's can't be "just first" and "just
last" row in the table in any RDBMS.
If you mean "first" in terms of inserting time, that's no problems:
SELECT f1.*
FROM Table1 f1, (SELECT Family, Min(Insert_Time) InsTime FROM Table1 GROUP
BY Family) f2
WHERE f1.Family = f2.Family
AND f1.Insert_Time = f2.InsTime
and so on.
Or you can simply write PLSQL block with a cursor loop and do what you're
gonna do within it.
With best wishes,
Dmitry Sirotkin.
Received on Thu Feb 24 2000 - 07:11:05 CST