Subject: Distinct
Posted By: Eddywardo Post Date: 8/31/2006 3:08:04 AM
Hi, I've recently moved a site to MSSQL server from Access and I've hit a few problems as it implements SQL differently. I've had a lot of duplicate data on the site which I have partly remedied by using SELECT DISTINCT - though I don't know how to use this in conjunction with SELECT * to cure other parts of my site that return duplicate data. Does anyone know how to do this? Thanks!

Reply By: shahchi1 Reply Date: 9/2/2006 7:41:40 AM
If you have a table called MyTable with duplicate rows

Then

SELECT DISTINCT Col1,Col2.. FROM myTable
INTO NewTable

TRUNCATE MyTable

INSERT INTO MyTable
SELECT * FROM NewTable

DROP TABLE NewTable

Go to topic 49149

Return to index page 186
Return to index page 185
Return to index page 184
Return to index page 183
Return to index page 182
Return to index page 181
Return to index page 180
Return to index page 179
Return to index page 178
Return to index page 177