1. Description
?? 最近在使用mysql區(qū)間查詢的時(shí)候遇到的一個(gè)問題。在此簡單記錄以下
SELECT * from table where 1 < id <100 ;
這樣查詢會(huì)返回table表中所有的數(shù)據(jù)或者空數(shù)據(jù),實(shí)際上的sql其實(shí)是
SELECT * from table where 1;
SELECT * from table where 0;
2. Solution
SELECT * from table where 1 < id and id <100 ;
SELECT * from table where id between 1 and 100 ;
博客
?? 個(gè)人博客同步更新