Show us the structure of the two tables.

andy

-----Original Message-----
From: Rick Faircloth [mailto:ric...@whitestonemedia.com] 
Sent: Sunday, October 03, 2010 2:12 PM
To: cf-talk
Subject: Can't figure out a query to accomplish this...


I'm using MySQL 5.

I want to compare table1 to table2 and get any
records in table1 that don't exist in table2.

I have tried everything I could think of and that
I could find on the 'net.

Nothing's working.

I've tried

        - select where not in (subselect)
        - select where not exists (subselect)
        - from dual
        - left join where null
        - blah, blah, blah (this one really performed badly)

How can I write this to make it work?

select   p.mls_number
from     properties p
where      p.mls = 'hmls'
and      p.mls_number not in (select pc.mls_number from properties_copy pc
where pc.mls = 'hmls')

Any kind suggestions for a weary soul?

Thanks,

Rick            





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337796
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to