Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: rownum kills Order... Is there a solution ?
Rownum should only be used in simple sql statements. What your code is
doing is retrieving the first 100 records as it is stored in the table (not
in lastname order) and doing its stuff on that.
Can't think of a solution though...yet ;-(
M
Pablo Picasso wrote in message <3777519d.272604113_at_enews.newsguy.com>...
>Hi all,
>
>I have 2 tables ..
>t_people and t_staff (linked by id)
>
>I want to select it with
>
>SELECT * FROM T_PEOPLE P, T_STAFF S WHERE
>P.ID = S.ID AND ROWNUM < 100 ORDER BY P.LASTNAME;
>
>The result is ordered by lastname, but there are gaps in the
>result, meaning, that result may contain the person with lastnames
>'Anker','Berlin','Breuer' but the person with lastname 'Barton' is
>ommitet.
>
>Is there a contruction , maybe with group by and having or something
>else to get correct results ?
>
>Any suggestion is welcome..
>
>Thanks in Advance
>
>Please mail to: oengst_at_cybernet-ag.net.mil (Spamprotect..remove .mil)
Received on Mon Jun 28 1999 - 07:36:00 CDT
![]() |
![]() |