View previous topic :: View next topic
|
Author |
Message |
sivapotla
New User
Joined: 29 Mar 2005 Posts: 2
|
|
|
|
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 |
|
|
radhakrishnan82
Active User
Joined: 31 Mar 2005 Posts: 435 Location: chennai, India
|
|
|
|
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 |
|
|
sivapotla
New User
Joined: 29 Mar 2005 Posts: 2
|
|
|
|
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 |
|
|
ovreddy
Active User
Joined: 06 Dec 2004 Posts: 211 Location: Keane Inc., Minneapolis USA.
|
|
Back to top |
|
|
gvt460
New User
Joined: 04 Mar 2005 Posts: 23
|
|
|
|
hi ur query is perfectly allright.
i tried it and it workd
select * from tablename where name like '%d';
vikram yadav |
|
Back to top |
|
|
avalanches
New User
Joined: 10 May 2005 Posts: 28
|
|
|
|
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 |
|
|
|