“table1”—> boodang_iphone contain—3000 records
“table2”–> boodang_iphonePushtest05302012 table contain —90 records
I need to get mismatch value in ‘boodang_iphonePushtest05302012’ compare table1 i write query like this
SELECT boodang_iphonePushtest05302012.devicetoken
FROM boodang_iphonePushtest05302012
left outer join boodang_iphone on
boodang_iphone.devicetoken=boodang_iphonePushtest05302012.devicetoken
where
boodang_iphonePushtest05302012.devicetoken != boodang_iphone.devicetoken
I am confused is it give correct data or not any one can we please guide me get mismatch value using joins
This query give you all records which exist in
boodang_iphonePushtest05302012but not inboodang_iphone. However you need to run the query once more by swapping the table, so it will give you all records exist inboodang_iphonebut not inboodang_iphonePushtest05302012(instead you can use the same query but joining the table by Right outer join). Then you should get the full result of the comparison.Also if you can change you where clause to
then would be much better. it is because if the value mismatches, then it will return NULL value from your second table and it always has a problem if you compare a NULL value to a valid data.