Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Pull out once

Author  Topic 

peace
Constraint Violating Yak Guru

420 Posts

Posted - 2012-05-17 : 21:47:40
ID Name Item
1 Ali Van
1 Ali Bus
1 Ali Car
1 Bel Van

How can I pull out to be as below?

ID Name Item
1 Ali Car
1 Bel Van

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-05-17 : 22:33:43
Check out the ROW_NUMBER() function.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

peace
Constraint Violating Yak Guru

420 Posts

Posted - 2012-05-17 : 22:46:08
Can anyone give example
thanks
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2012-05-18 : 04:16:26
How do you determine which of the rows for Ali to be returned?

- Lumbago
My blog-> http://thefirstsql.com/2011/07/08/how-to-find-gaps-in-identity-columns-at-the-speed-of-light/
Go to Top of Page
   

- Advertisement -