473,396 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1405
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

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

Similar topics

0
by: Soefara | last post by:
Dear Sirs, I am experiencing strange results when trying to optimize a LEFT JOIN on 3 tables using MySQL. Given 3 tables A, B, C such as the following: create table A ( uniqueId int not...
6
by: Allan | last post by:
Please help, below is my problem. Let's say I have 2 tables, a Products table and a Colors table that go as follow: Table Products prodID Name 1 shirt 2 tshirt
4
by: jbm05 | last post by:
Hi, I'm curious about the computational complexity of a query I have. The query contains multiple nested self left joins, starting with a simple select, then doing a self left join with the...
1
by: Steve | last post by:
I have a SQL query I'm invoking via VB6 & ADO 2.8, that requires three "Left Outer Joins" in order to return every transaction for a specific set of criteria. Using three "Left Outer Joins"...
7
by: Steve | last post by:
I have a SQL query I'm invoking via VB6 & ADO 2.8, that requires three "Left Outer Joins" in order to return every transaction for a specific set of criteria. Using three "Left Outer Joins"...
3
by: Doug | last post by:
Hi, I'm more familiar with MSSQL than Access syntax and have run into a problem with correctly putting ( )'s around the joins in a 3 table query. I want to INNER JOIN lenders and accounts and...
2
by: tricard | last post by:
Good day all, I have a large outer joined query that I want to have some criteria. The select query is gathering all part numbers from tblPartNumbers, left joining to tblPartNumberVendor (since...
0
by: mlarson | last post by:
I have a program that worked fine then they needed to be able to also see the empty cells (inmate cells) on a housing unit when they ran the query. So what I had to do was take two tables and...
2
by: David F | last post by:
Hello, I have what seems like a simple left join query, but Access returns results like it's an inner join. I've tried numerous combinations without success. I have a table (ProjectList)...
4
by: polycom | last post by:
Assistance needed to optimize this query SELECT SD.content_id AS Id, SD.title AS Title, CT.name AS Contenttype, PV.content_id AS SponsorId, ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.