View Single Post
Old 03-07-2013, 02:35 PM   PM User | #1
sitechooser
New Coder

 
Join Date: Jan 2013
Posts: 16
Thanks: 6
Thanked 0 Times in 0 Posts
sitechooser is an unknown quantity at this point
More Efficient Query Needed

Hi All

Does anyone have an idea how to run this query...

Code:
SELECT * 
FROM [TableName] 
WHERE [ColumnName] IN
(
      SELECT [ColumnName] 
      FROM [TableName] 
      GROUP BY [ColumnName] 
      HAVING COUNT(*) > 1 
)
ORDER BY [ColumnName]
without the sub query?

The sub query option seems to be taking ages to run. Is there a more efficient query that does the same thing?

Thanks in advance for any help.
sitechooser is offline   Reply With Quote