473,385 Members | 1,312 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,385 software developers and data experts.

Minus query

24
hi all
I'm using two tables called t1,t2..i need to display the id's that are there in the 1st table but not in the second table..i hope the minus function will give the results..the query i wrote is

select t1.id from t1
minus
select t2.id from t2

is this query correct...its not working..please help

thank you
Sep 22 '07 #1
1 2769
azimmer
200 Expert 100+
hi all
I'm using two tables called t1,t2..i need to display the id's that are there in the 1st table but not in the second table..i hope the minus function will give the results..the query i wrote is

select t1.id from t1
minus
select t2.id from t2

is this query correct...its not working..please help

thank you
It works like this:
Expand|Select|Wrap|Line Numbers
  1. SELECT t1.id
  2. FROM t1
  3. WHERE t1.id not in (SELECT t2.id FROM t2)
  4.  
Sep 22 '07 #2

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

Similar topics

1
by: Rama S | last post by:
Hi, We need a query which retrieves option_code, for a plan from OPTION table which are unique in (market, "ALL"). I have an example below PLAN MARKET OPTION_CODE RATE...
1
by: Sumanth Suri | last post by:
Hi, I've used the minus functionality which is available in Oracle and i would like to use it in SQL server, but i don't know how to. The folllowing is how it works in Oracle Select symbols...
2
by: Newbie | last post by:
Hi, Could someone please tell how MINUS operator works for comparing and giving non-matching records in Table1? Does MINUS operator compares all records of Table1 with all records of Table2 to...
1
by: Bibic0711 | last post by:
I am having problem on following situation, any comments are welcome. I have this table A which contents most of the data, that needs to be query based on a name field in table B and was linked...
13
by: Marc | last post by:
Hi, I've been lurking on clc for a few months now, and want to start by thanking the regulars here for opening my eyes to a whole new dimension of "knowing c". Considering I had never even...
6
by: Matthew Cook | last post by:
I would like to overload the unary minus operator so that I can negate an instance of a class and pass that instance to a function without creating an explicit temporary variable. Here is an...
7
Dököll
by: Dököll | last post by:
Greetings and salutations! Ran a quick search here a found this: http://www.thescripts.com/forum/thread700194-Minus+date.html Though it is very helpful when dealing with dates alone, I cannot...
1
nathj
by: nathj | last post by:
Hi, I'm currently developing a web system that allows people to register for the various events my organisation hosts. I have completed the online registration system and now need to mnake a...
2
by: CenturionX | last post by:
Hello everybody i'm trying to use the minus operator like that: (SELECT DISTINCT TRIM(S.Lname & ', ' & Fname) AS Name, S.SID FROM Salesperson as S, Schedule as H WHERE S.SID = H.SID AND H.Day =...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.