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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 how can i get distinct records when....

Author  Topic 

asifbhura
Posting Yak Master

165 Posts

Posted - 2009-03-18 : 03:20:23
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

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-03-18 : 03:24:01
can u post expected output
Go to Top of Page

asifbhura
Posting Yak Master

165 Posts

Posted - 2009-03-18 : 03:33:52
hi bklr

per_to per_from
6000144 6000144
6000125 6000103
6000100 6000103

something like this

Go to Top of Page

matty
Posting Yak Master

161 Posts

Posted - 2009-03-18 : 04:10:41
SELECT DISTINCT per_to, per_from
FROM table
Go to Top of Page

Nageswar9
Aged Yak Warrior

600 Posts

Posted - 2009-03-18 : 04:34:10
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
   

- Advertisement -