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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 how can i get distinct records when....
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

165 Posts

Posted - 03/18/2009 :  03:20:23  Show Profile  Reply with Quote
Hi all,

I have one table which is having column name like( perid,per_to,per_from,ApplicationId)
per_to per_from Appl.Id PerId
6000144 6000144 1 15
6000144 6000144 3 16
6000144 6000144 5 17
6000125 6000103 1 26
6000125 6000103 2 27
6000100 6000103 4 28

now i need distinct per_to means no duplicate rows

Flowing Fount of Yak Knowledge

1693 Posts

Posted - 03/18/2009 :  03:24:01  Show Profile  Reply with Quote
can u post expected output
Go to Top of Page

Posting Yak Master

165 Posts

Posted - 03/18/2009 :  03:33:52  Show Profile  Reply with Quote
hi bklr

per_to per_from
6000144 6000144
6000125 6000103
6000100 6000103

something like this

Go to Top of Page

Posting Yak Master

161 Posts

Posted - 03/18/2009 :  04:10:41  Show Profile  Reply with Quote
SELECT DISTINCT per_to, per_from
FROM table
Go to Top of Page

Aged Yak Warrior

600 Posts

Posted - 03/18/2009 :  04:34:10  Show Profile  Reply with Quote
The Values of Appl.Id ,PerId are different in the table
U want per_to ,per_from distinct values only
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000