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

Need info about "like"


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

New User


Joined: 29 Mar 2005
Posts: 2

PostPosted: Tue Apr 12, 2005 11:14 pm
Reply with quote

How should I use "like" in a query when I want to select records having data that end with some character...... let's say we have London, Japan as data ... then can I use
Code:

"select country from sometable where cname like     '%n'       "

I tried this but I couldn't get any results ....so if anyone knows why can you please help?
Back to top
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Wed Apr 13, 2005 1:47 pm
Reply with quote

Use the query below.

select country from sometable where cname like '%N'.(try with caps N inside the quotes)

Let us know whether its working fine now or having other problem.
does it displays any sql error message?
Back to top
View user's profile Send private message
sivapotla

New User


Joined: 29 Mar 2005
Posts: 2

PostPosted: Wed Apr 13, 2005 11:46 pm
Reply with quote

Hello Krishnan thanks for ur reply,
i already tried this option,
there were no errors,
the problem is there was no output...
Back to top
View user's profile Send private message
ovreddy

Active User


Joined: 06 Dec 2004
Posts: 211
Location: Keane Inc., Minneapolis USA.

PostPosted: Wed May 04, 2005 2:16 pm
Reply with quote

Hi Siva,

Please refer to the link publib.boulder.ibm.com/infocenter/db2help/index.jsp?topic=/com.ibm.db2.udb.doc/ad/r0008190.htm for more information on LIKE.

Thanks,
Reddy
Back to top
View user's profile Send private message
gvt460

New User


Joined: 04 Mar 2005
Posts: 23

PostPosted: Thu May 05, 2005 4:43 pm
Reply with quote

hi ur query is perfectly allright.
i tried it and it workd

select * from tablename where name like '%d';

vikram yadav
Back to top
View user's profile Send private message
avalanches

New User


Joined: 10 May 2005
Posts: 28

PostPosted: Tue May 10, 2005 3:21 pm
Reply with quote

There might not be any values matching this pattern also because the query is not resulting with a row.

How do I find out is there are any char ending with '%' itself?!?!?!
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 PuTTY - "User is not a surrogate... IBM Tools 5
No new posts Newbie Stuck on "Duplicate Datas... TSO/ISPF 5
No new posts RABBIT HOLE NEEDED - "Live"... All Other Mainframe Topics 0
No new posts in REXX,how to get sysprt info CLIST & REXX 9
No new posts Using PARM=('JPn"&SYMBOL&quo... DFSORT/ICETOOL 2
Search our Forums:

Back to Top