473,472 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

get non matching rows from table 2

2 New Member
Hello,
I've been having trouble in getting proper results querying the following I have 2 tables T1 & T2, each of which has a single column C1. the data in each of the tables are as follows:
T1.c1
1
4
8
9
0
a
c
d
T2.c1
1
2
3
8
9

I would like the non matching rows only from T2, i.e I expect the results 2, 3 from T2. Any help to query the tables will be greatly appreciated.
Jan 25 '08 #1
2 2496
ck9663
2,878 Recognized Expert Specialist
Hello,
I've been having trouble in getting proper results querying the following I have 2 tables T1 & T2, each of which has a single column C1. the data in each of the tables are as follows:
T1.c1
1
4
8
9
0
a
c
d
T2.c1
1
2
3
8
9

I would like the non matching rows only from T2, i.e I expect the results 2, 3 from T2. Any help to query the tables will be greatly appreciated.
try:
select * from t2 where c1 not in (select c1 from t1)

-- ck
Jan 25 '08 #2
randomSql
2 New Member
Thanks very much for your reply. I also tried using this and it worked , but yours seems simpler.
select t2.c1 from t2 except select t2.c1 from t2 inner join t1 on t1.c1=t2.c1
Jan 28 '08 #3

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

Similar topics

0
by: Irlan agous | last post by:
Hello all, i have this matching story. What i want to do, is to check the variable $betaling if this is 0 or 1. But the id from the tabel form have to be compared with $persid from the table...
2
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...
1
by: Henry | last post by:
I have a table that stores a list of zip codes using a varchar column type, and I need to perform some string prefix pattern matching search. Let's say that I have the columns: 94000-1235 94001...
2
by: laurenq uantrell | last post by:
IS there a way to combine all matching rows in a table so that it outputs as one row, for example: tblMyStuff UniqueID int IDENTITY ParentID int SomeSuch nvarchar(50) SomeSuch2 nvarchar(50) ...
1
by: David C. Barber | last post by:
I'm trying to determine if any matching records exist on a LIKE query performing a partial match of last names to a remote back-end database in the most efficient manner possible. LAN Traffic...
9
by: Chi Man Wong | last post by:
I have a problem using VB which I'll try to explain: In sheet A I have a table with : column 1: dates (e.g. 01-01-2005) over a range of 3 years column 2 till 8: numbers In sheet B I have a...
7
by: figital | last post by:
Given an ID (column B), I need to find which IDs have identical data. That is, given '200', I want the desired result to be: 100 The idea is that the system sees that id=200 has 5 records with...
2
by: littleccguy | last post by:
(new to programming/student) I am using VS.Net 2003 (visual basic) on Windows XP with SQL Server 2005 Express. I have one table in the SQL database that i brought into VS using DataGrid. I am...
4
by: =?iso-8859-1?B?VmFyZ2hq5HJ0YQ==?= | last post by:
Hi, I shall try to be short and to the point, this is a problem that no one IRL has yet been able to help me with thus far. Yet it feels as thought this is something that many people must tackle...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
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...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.