| Author |
Urgent : Help needed in writing a SQL query
|
Raj Sikka
Ranch Hand
Joined: Apr 11, 2003
Posts: 34
|
|
Hi , I have a table TEMP which has three columns say COL1,COL2,COL3 The data in that table is like : COL1 COL2 COL3 -------------------------- 1 65536 1 1 65536 2 1 65537 1 1 65537 1 1 65538 2 I need to write a query which displays results; 65536 1 65537 1 65538 2 i,e, For each distinct COL2 get the minimum of COL3. Please help. Thanks in advance, Sree
|
 |
SJ Adnams
Ranch Hand
Joined: Sep 28, 2001
Posts: 925
|
|
|
select col2, min(col3) from temp group by col2;
|
 |
 |
|
|
subject: Urgent : Help needed in writing a SQL query
|
|
|