IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SQL to fetch data that are not there in the list


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
revdpoel

New User


Joined: 01 Nov 2006
Posts: 56

PostPosted: Sun Feb 08, 2009 2:02 am
Reply with quote

I have a table with 6000 codes
I have un update statement which should update 87 rows

Update table
set STATUS = 'N'
where code IN ('A', 'B', etc)

It only updates 80 rows

There are seven codes in the IN-list not present in the table.
What is the SQL-statement to know which 7 codes are not present?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sun Feb 08, 2009 2:09 am
Reply with quote

where code NOT IN ('A', 'B', etc)?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Feb 08, 2009 4:09 am
Reply with quote

Hello,

Quote:
I have un update statement which should update 87 rows
How do you know there should be 87?

The same "where" that would identify these 87 would also include them for update icon_confused.gif

Quote:
where code NOT IN ('A', 'B', etc)?
I believe this would return far too many rows. . .
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Feb 09, 2009 12:44 pm
Reply with quote

Hi,

Could you please be little more cryptic in choosing the subject title..grin..
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top