Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selection of Single Instance from Multiple Keys - How Do I

Status
Not open for further replies.

cartw19

Programmer
Feb 11, 2003
8
GB
I have a table with multiple occurences of key values, how do I retrieve the first row only on a Select statement.
 
First is not a relational concept. Records in a table does not have a specific order, they are only identified by the values in the columns.

To get the highest value with each group you can use

select pk1,max(pk2) from t group by pk1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top