Home » RDBMS Server » Server Administration » top rows
top rows [message #373508] Thu, 19 April 2001 22:35 Go to next message
savrat
Messages: 1
Registered: April 2001
Junior Member
i j k
----------- ----------- -----------
1 1 11
1 2 12
1 2 13
2 2 14
2 2 15
3 1 11

(6 row(s) affected)

is there a query to get the following result
1 1 11
2 2 14
3 1 11
Re: top rows [message #373509 is a reply to message #373508] Thu, 19 April 2001 23:58 Go to previous message
Thirumalai and Prakash
Messages: 23
Registered: March 2001
Junior Member
Hi savrat,

Try this,

SELECT * FROM table_name WHERE rowid IN (SELECT rowid FROM table_name WHERE
(i,rowid) in (SELECT i,min(rowid) FROM table_name GROUP BY i))

Regards
Thirumalai,S
Previous Topic: Problem with foreign key to a unique key
Next Topic: Urgent! How can I create view witch do calculates a sum
Goto Forum:
  


Current Time: Mon Dec 23 09:42:28 CST 2024