--區分大小寫性能比較低select * from Students where Age >1 and Age <4select * from Students where Age between 1 and 4--取出一到四的數據包含一和四(between在數據庫有優化,性能比較好,高于上面的語句)select * from Students where Age in(1,2,3)--查詢出年齡包含1,2,3的數據select * from Students where Name like 'a%' --以a開頭的后面不管有幾個字符都可以匹配select * from Students where Name like '_a%'--第二個字符是a的,_表示一個任意字符select * from Students where Name like '__a%' --前兩個是任意字符,第三個是a字符的進行匹配select * from Students where Name like '%[0-9]%'--查詢中間任何位置有數字的select * from Students where Name like '%[a-z]%'--查出中間任何位置有字母的select * from Students where Name like '%[0-9a-z]%'--查詢中間任何位置有數字或字母的select * from Students where Name like '%[^0-9]%' --查詢中間任何位置不是數字的select * from Students where Name like '%[^0-9]' --查詢最后位置不是數字的select * from Students where Name not like '%[0-9]'
新聞熱點
疑難解答