473,671 Members | 2,484 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting non matching records from 2 tables?

1 New Member
If you have:

TBL1
field1 field2
a1-1 a1-2
a2-2 a2-2

&

TBL2
field1 field2
b1-1 b1-2
a2-2 a2-2

I want t get records from TBL2 that do not match in TBL1.field1 or TBL2.field1?
In this case i would get b1-1 from TBL2

Thanks all
Sep 6 '06 #1
1 6658
bagaudin
3 New Member
SELECT Field1
FROM Table2
WHERE (NOT (Field1 IN
(SELECT Field1
FROM Table1)))
Sep 6 '06 #2

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

Similar topics

23
1857
by: middletree | last post by:
I've seen posts here and elsewhere which read something along the lines of "PULLNG MY HAIR OUT!!!!!" or "HELLLLPPP!". Well, I know that kind of subject line isn't descriptive, but I sure can relate right now. I've been struggling for days--days!!-- on this one simple query. I really need to get past this thing and move on. Please help. I have a classic ASP page, and it gives you 4 dropdowns. You can select any or none of them....
2
2419
by: rowan[canspam] | last post by:
I have two tables ITEMS: items,description,mfg MANUFACTURER: mfg,full_name The items database has 230,000 records, the manufacturer, 493 records. I want to see how many records in the items table don't have a matching record in the
9
10635
by: Robert Schneider | last post by:
Hi to all, I don't understand that: I try to delete a record via JDBC. But I always get the error SQL7008 with the error code 3. It seems that this has something to do with journaling, since the table from which I want to delete has two foreign keys that references two other tables and it is also referenced by another table. But this shouldn't be a problem, since I set the commit mode to none (or *none) at all places where this makes...
3
2321
by: BrianDP | last post by:
I have a database with a split front end/back end. There is a key table in the back end called Catalog, and it is sort of a central key table for all sorts of things. It's a list of all the jobs that have ever been worked on at our company. Records are getting lost out of this table, but I have no way of figuring out how they're being deleted. Records should NEVER be deleted out of this table. They can be marked as inactive, or...
3
3057
by: klufkee | last post by:
Hi all, I have two tables that are related to each other. One has 30K records while the other has 500. I ran a 'Without Matching' query to find records in the larger table that didn't have a matching record in the smaller table, however now I want to delete those records. Is there an easy way to do this? Thanks, Bill
7
13342
by: Petepinca | last post by:
I have 2 Access tables. One has a field with a 4 character product id. Example data: "3210". The other table has the same product id's for matching records BUT has leading characters: "RD3210", etc. I want to match records in an Access query that will match the fields based on the last 4 characters, which fortunately, are unique in both tables. I can edit in SQL View if necessary. Thanks for any help.
8
2059
by: mike11d11 | last post by:
I have a dataset with a account table and another table that contains transactions for accounts in the account table. I create a crystal report based off an inner join query of the two tables but takes way too long to generate. I was told if I can get them into one table that would fix my speed issue. I'm thinking if there is some way to maybe create a merged table of the two together and only getting data from both tables where the...
4
1705
by: sesling | last post by:
I have two tables that contain identical fields. (Account, Amount, Customer ID). I have a query that joins on those three fields. For the most part when matching records I get a one for one match. However, there are incidents where let say in table one I have 3 records that contain they following values (Account= 1234, Amount = 100.00, Customer ID = 9870. In table two I have 4 records that have Account = 1234, Amount = 100.00, Customer ID =...
9
4630
by: warrior2009 | last post by:
I have 2 lists (unlinked and unrelated), where one can be called the parent and the other the child with one to many relationship between parent-child. The child table is really big, over a million records. The link between the two, is a set of 3 fields that must be equal between the two. So when the two match, there can be a number of records in the child field, because it is related to the usage history of the parent record. So here is my...
0
8401
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8824
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8603
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7444
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5703
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4416
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2060
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.