all groups > sql server programming > november 2004 >
You're in the

sql server programming

group:

Duplicate Column Question


Duplicate Column Question george
11/5/2004 7:21:46 PM
sql server programming:
Hi,

I am doing an inner join which results with duplicate columns and I am
wondering if there is a way to remove the duplicate columns? I understand I
can do it in the select statement however there is alot of columns i need in
the resultset so looking for a better way. Any suggestions?

Thanks

RE: Duplicate Column Question Nazeer Oasis
11/5/2004 9:53:04 PM
Hi George,

This should pull out your duplicate entries
SELECT colName FROM tableName GROUP BY colName HAVING COUNT(colName) > 1

-----------------
Nazeer
Dimensions India
-----------------

[quoted text, click to view]
Re: Duplicate Column Question David Portas
11/6/2004 9:53:50 AM
Just list the required columns in the SELECT statement. If you have many
columns you can use Query Analyzer's object browser which lets you drag the
column list into the query without lots of typing.

--
David Portas
SQL Server MVP
--

AddThis Social Bookmark Button