469,282 Members | 1,708 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

LEFT JOIN Query Help

Hello everybody,

I have two tables : ac_online_scanned_tkts_1 and TK_IMPORT_TICKET1.
Both have external barcodes of tickets, but not all of them in ac_online_scanned_tkts_1 table exist in TK_IMPORT_TICKET1 table. I want a list of all those external barcodes that exist in ac_online_scanned_tkts_1 table but do not exist in TK_IMPORT_TICKET1 table. I am using the follwoing LEFT JOIN query to get these results, but I am not getting the desired help. Can anybody help me ?

SELECT ac_online_scanned_tkts_1.External_Sr_No, TK_IMPORT_TICKET1.TK_SERIAL_EXTERNAL, TK_IMPORT_TICKET1.TK_SERIAL_INTERNAL
FROM ac_online_scanned_tkts_1 LEFT JOIN TK_IMPORT_TICKET1 ON ac_online_scanned_tkts_1.External_Sr_No = TK_IMPORT_TICKET1.TK_SERIAL_EXTERNAL
WHERE ac_online_scanned_tkts_1.External_Sr_No <> TK_IMPORT_TICKET1.TK_SERIAL_EXTERNAL

Thanks in advance.
Jun 21 '07 #1
2 1196
FishVal
2,653 Expert 2GB
Hello everybody,

I have two tables : ac_online_scanned_tkts_1 and TK_IMPORT_TICKET1.
Both have external barcodes of tickets, but not all of them in ac_online_scanned_tkts_1 table exist in TK_IMPORT_TICKET1 table. I want a list of all those external barcodes that exist in ac_online_scanned_tkts_1 table but do not exist in TK_IMPORT_TICKET1 table. I am using the follwoing LEFT JOIN query to get these results, but I am not getting the desired help. Can anybody help me ?

SELECT ac_online_scanned_tkts_1.External_Sr_No, TK_IMPORT_TICKET1.TK_SERIAL_EXTERNAL, TK_IMPORT_TICKET1.TK_SERIAL_INTERNAL
FROM ac_online_scanned_tkts_1 LEFT JOIN TK_IMPORT_TICKET1 ON ac_online_scanned_tkts_1.External_Sr_No = TK_IMPORT_TICKET1.TK_SERIAL_EXTERNAL
WHERE ac_online_scanned_tkts_1.External_Sr_No <> TK_IMPORT_TICKET1.TK_SERIAL_EXTERNAL

Thanks in advance.
Hi!
This seems to work but from some unknown to me reasons it doesn't.
Fortunately if you replace the condition in 'WHERE' clause with the following
ac_online_scanned_tkts_1.External_Sr_No Is Null
it will work much more better.
Jun 21 '07 #2
Hi!
This seems to work but from some unknown to me reasons it doesn't.
Fortunately if you replace the condition in 'WHERE' clause with the following
ac_online_scanned_tkts_1.External_Sr_No Is Null
it will work much more better.
Thanks. I thought it doesn't return NULL for values not found in one table, and so I was checking for spaces.
Jun 21 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by polycom | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.