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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

last status

Status
Not open for further replies.

piulibero

IS-IT--Management
Feb 4, 2004
5
GR
hi to all,i have a problem that may seem silly to most of you.

my table looks like:
ID CUSTOMERID NAME
-------------------------------------
1 12345 JOHN
2 12345 JOHN
3 56789 ANGELO
4 56789 ANGELO
5 56789 ANGELO
6 56789 ANGELO
7 87654 TIM
8 87654 TIM
9 87654 TIM

the outcome i'd desire is like this:

2 12345 JOHN
6 56789 ANGELO
9 87654 TIM


thank you
 
Code:
select max(id),customeid,name
from t
group by customerid,name
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top