Re: Alright Smart Guys... Here's a simple one. [message #372516] |
Sat, 17 February 2001 07:37 |
Robert Moy
Messages: 15 Registered: December 2000
|
Junior Member |
|
|
Hello Ed:
an improvement over my code by arrange in the order you by adding a column and set the column with rownum:
1 create table dates2(girl2, datenum2) as
2 select girl, max(datenum)
3 from dates
4 where datenum in
5 (select Max(datenum)
6 from dates
7 where datenum < 4
8 group by girl)
9* group by girl
SQL> alter table dates
2 add (order2 number(2));
Table altered.
SQL> update dates
2 set order2 =rownum;
12 rows updated.
SQL> select girl, datenum, guy from dates
2 where girl || datenum in
3 (select girl2 || datenum2
4 from dates2)
5 Order by order2
6 /
GIRL DATENUM GUY
----- --------- --------
Jen 3 Matt
Lori 2 Mike
Molly 1 Anthony
Lisa 3 John
Good Luck
|
|
|