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
 SQL query

Author  Topic 

pari3006
Starting Member

1 Post

Posted - 2013-07-15 : 10:25:16
I have a table of the following format

COl_A COL_B COL_C COL_D
A B C D
A B C D
A B1 C1 D1A
A B2 C2 D2
A B C1 D3
A1 B C1 D
A1 B1 C1 D1


i want result as
Col_A COl_B COl_C COL_D
A B C D
A B1 C1 D1A
A B2 C2 D2
A B C1 D3
A1 B C1 D
A1 B1 C1 D1

Please help

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-07-15 : 11:27:09
quote:
Originally posted by pari3006

I have a table of the following format

COl_A COL_B COL_C COL_D
A B C D
A B C D
A B1 C1 D1A
A B2 C2 D2
A B C1 D3
A1 B C1 D
A1 B1 C1 D1


i want result as
Col_A COl_B COl_C COL_D
A B C D
A B1 C1 D1A
A B2 C2 D2
A B C1 D3
A1 B C1 D
A1 B1 C1 D1


Please help


SELECT DISTINCT
COL_A,COL_B,COL_C,COL_D
FROM
YourTable


Or,even this:
SELECT
COL_A,COL_B,COL_C,COL_D
FROM
YourTable
GROUP BY
COL_A,COL_B,COL_C,COL_D

Go to Top of Page
   

- Advertisement -