我正在尝试从数据库中获取状态从w或c开始的元素..我尝试了此查询,但页面变为空白..
$test1=mysql_query("select * from railways where status like('w%') || like('c%')");
在这种情况下如何编写查询???
答案 0 :(得分:6)
尝试
select * from railways where status like('w%') or status like('c%')
答案 1 :(得分:1)
SELECT * FROM railways WHERE SUBSTR(status,1,1) IN ('w','c')