tags:

views:

56

answers:

2

I am trying to get the elements from the database where the status begins from either w or c.. i tried this query but the page gets blank..

$test1=mysql_query("select * from railways where status like('w%') || like('c%')");

how is this query written in that case???

+6  A: 

Try with

select * from railways where status like('w%') or status like('c%')
Davide Gualano
thanks a lot ...
Sachindra
+1  A: 
SELECT * FROM railways WHERE SUBSTR(status,1,1) IN ('w','c')
Alec
It works, but gets no profit from indexing.
newtover