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
 
Like used in select statement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
ajayvamsi
Currently Banned

New User


Joined: 21 Jul 2005
Posts: 56
Location: Hyderabad

PostPosted: Sat Nov 12, 2005 12:17 pm    Post subject: Like used in select statement
Reply with quote

Hi Friends,

My requirement is I need to pick all the names in a column which r having percentage symbol in between the names...!!

Example::

let us suppose I have a table xyz with Name,Age as fields

Name Age

aaa%aaa 11
bbbbbbbb 12
cc%ccccc 45
d%ccccc 12

please help me to write a query to pick out all the Names like::
aaa%aaa
cc%ccccc
d%ccccc

Thanks in advance,
ajay
Back to top
View user's profile Send private message

chowdamhemalatha

New User


Joined: 25 Sep 2005
Posts: 2
Location: bangalore

PostPosted: Sun Nov 13, 2005 11:32 am    Post subject: Re: Like used in select statement
Reply with quote

Hi,

u can use LIKE clause in the SELECT stmt as shown below.

SELECT col1 FROM tab1 WHERE col1 LIKE '_%%'

Rgds,
Hema.
Back to top
View user's profile Send private message
reshma

New User


Joined: 10 Sep 2005
Posts: 9
Location: software engineer

PostPosted: Sun Nov 13, 2005 12:15 pm    Post subject: Re: Like used in select statement
Reply with quote

hema,

i was confused with ur query ..in the above said query by u ,u should have mentioned where col1 like '_%%%' ....tell me if iam wrong

regards,
reshma
Back to top
View user's profile Send private message
ajayvamsi
Currently Banned

New User


Joined: 21 Jul 2005
Posts: 56
Location: Hyderabad

PostPosted: Sun Nov 13, 2005 2:52 pm    Post subject: Re: Like used in select statement
Reply with quote

Hema,
I am confused with the query..!! I heard that we need to go usling for "Escape"

Please correct here

select name from xyz where name like '%+%sdfdf' escape '+';
Is this wrong...!!
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 Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am
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

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