Pinned topic Problem ( SELECT statement)
insert into testTab values(1, 'chandu'), (2, 'abc')
I will pass the set of ids( like '2,3,5' ) from front-end
How to get the ids which does not existed in my table testTab
Output should be:
Please help on this... Am new to DB2 z/OS
Note: Only the SELECT statement( not to use temparory tables and all)
Re: Problem ( SELECT statement)2013-02-26T15:51:11ZThis is the accepted answer. This is the accepted answer.
- SystemAdmin 110000D4XK
what is the maximum number of ids you will be sending in that list?
do you need this implemented using a single SQL statement or do you want to use a procedure?
Sreeharsha_Naik 27000590731 Post
Re: Problem ( SELECT statement)2013-05-17T16:08:25ZThis is the accepted answer. This is the accepted answer.
From what I have understood - You should have a mechanism to save all of your ID's somewhere - Another DB2 Table perhaps ? If your table 1 contains the actual information and table 2 contains all the ID's - You can write a SELECT query :
SELECT ID FROM TABLE1 WHERE ID NOT IN ( SELECT ID FROM TABLE 2 ) ;