Like operator [message #383608] |
Thu, 29 January 2009 05:25  |
rsreddy28
Messages: 295 Registered: May 2007
|
Senior Member |
|
|
Hello All,
I've a SQL query like :
SQL > SELECT * FROM WVO_STORAGE_DETAILS_HIST WHERE host_name like ('%us%','%US%')
And I want the output which shows matches like USAZ as well as usdb.
I'm not able to find out even after cracking a lot .
Please help me out as its very urgent , one last time .
regards,
Raj
|
|
|
|
|
|
|
Re: Like operator [message #383955 is a reply to message #383875] |
Sun, 01 February 2009 00:51  |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
sreenu80 wrote on Sat, 31 January 2009 03:42 | Hi
SELECT * FROM WVO_STORAGE_DETAILS_HIST WHERE host_name like ('us%')
union
SELECT * FROM WVO_STORAGE_DETAILS_HIST WHERE host_name like ('US%')
Hope this will work
|
If you think this solution is better than Maahers, you should at least use union all instead of union. The first statement will never return a row that the second will return.
|
|
|