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

THREE CONDITIONS ON 10 INPUTS


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

New User


Joined: 28 Aug 2006
Posts: 9
Location: pune

PostPosted: Thu Nov 22, 2007 9:32 pm
Reply with quote

HI

i have a coloumn dname i n a table

which contains a,b,c----------------

i want to write a query such as

select dname from table
where dname = a,b,c,d,e,f,g

and dname not in(m,n,a,h)

and disp=i

now dname and disp conditions should be applied for only

a,b,c,d,e,f not for all dname rows in table

so plz tell me how can i write a query
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Thu Nov 22, 2007 9:57 pm
Reply with quote

First off your query is wrong, you have A in "dname not in" and A in the
"where dname = "

Code:

select dname from table
where dname not in(m,n,h)
and (dname in (a,b,c,d,e,f,g) and disp = i)
for read only with UR
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 How to load to DB2 with column level ... DB2 6
No new posts Db2 SQL - how to switch among differe... DB2 18
No new posts To search DB2 table based on Conditio... DB2 1
This topic is locked: you cannot edit posts or make replies. SUM based on two conditions using SYN... SYNCSORT 7
No new posts SORT - Multiple Conditions DFSORT/ICETOOL 4
Search our Forums:

Back to Top