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

SQL statement to pick up the states starting with SL & P


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

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Thu Sep 11, 2008 8:34 pm
Reply with quote

Hi,

I am just starting with DB2 and I need this pretty urgent.

My Db2 table has following feilds:
Policy
state

Can any one please suggest an SQL to do the following:
1. I need to pick up the states starting with SL & PF.
2. The results should order by policy
3. TOTAL NUMBER OF STATES THAT BEGIN BY sl%,ov% and of% or f%, by policy

Thanks for all the help you can provide.
Back to top
View user's profile Send private message
Jerine_Cao Xiaojie

New User


Joined: 07 Sep 2008
Posts: 2
Location: Nanchang

PostPosted: Thu Sep 18, 2008 10:55 pm
Reply with quote

hello,

select state from TableName where state = 'sl%' or state = 'pf%' order by policy desc

I wish it can do help for you. icon_smile.gif
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 JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
No new posts list pds members name starting with xyz CLIST & REXX 11
No new posts Relate COBOL statements to EGL statement All Other Mainframe Topics 0
No new posts process statement for SUPREC, CMPCOLM... TSO/ISPF 4
No new posts SYNCSORT/ICETOOL JOINKEYS SORT Statem... DFSORT/ICETOOL 13
Search our Forums:

Back to Top