[dba-SQLServer] Deletion based on Compound Distinct Selection

Ron Moore rmoore at comtechpst.com
Fri Sep 24 13:11:28 CDT 2004


Stuart wrote:

<quote>
You can only use one value for an "In". You can prossibly concatentate the 
two values. If they are strings, try something like 

Where (Column1 + Column2) In 
    Select Distinct  Column1 + Column2.....

If numeric, you will probably need to convert them to strings first.

</quote>

Stuart,

Thanks for that.  I didn't realize the "IN" could only accommodate 1 value.
In the interim, I selected distinct (on 3 columns now) and put results in a
temp table.  Then I was able to isolate records from the other table based
on a join to the temp table where the 3 columns matched.

All is well now.
Thanks Again,
Ron





More information about the dba-SQLServer mailing list