Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
SQL statement to pick up the states starting with SL & P

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: SQL statement to pick up the states starting with SL & P
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm
No new posts How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us