SQL Query
Posted in 1991
----- Begin Included Message -----
From: RUCHI@CFRVM.CFR.USF.EDU
To: informix-list@rmy.emory.edu
Subject: SQL Query
X-Informix-List-Id: <list.655>
Status: R
I have two tables that joines them by project_no. Following are two tables
with its values.
TABLE A TABLE B
-----------------------
project_no project_no
________________________
1 1
2 -
3 3
When I user outer join then it says that it found 3 rows which is correct.
But is there anyway I can do my query to find the project_no from TABLE A
that is not in the TABLE B? So, my result should say only one row found
from TABLE A.
This is very important. If there is no simplest way I can do such query then
any other suggestions are welcome.
Thanks. Ruchi.
----- End Included Message -----
Here the way I did it:
select project_no
from taba
where project_no not in
(select project_no
from tabb);
gives the result:
2
select project_no
from taba a
where project_no in
(select b.col1
from project_no b
where a.project_no = b.project_no);
gives the result:
1
3
******************************************************************************
Eric Lieber * *
DeskTalk Systems Inc. * * Hermits do not have peer
19401 S. Vermont Ave * * pressure.
Torrance, CA., 90502 * *
Telephone: (310) 323-5998 * *
(800) 394-UNIX * *
Fax: (310) 323-6197 * Standard *
eric@jordan.desktalk.com * Disclaimer *
******************************************************************************