幾天前寫個語句用到好幾個條件,用了and與or感覺很繁瑣,現在介紹個新寫法,與大家一起進步。
select * from table where (id=1 or id=2) and price>=10;
則這條語句執行的是id=1或id=2,並且price大於等於10。等同於
select * from table where id = 1 and price >= 10 or id = 2 and price >=10;
幾天前寫個語句用到好幾個條件,用了and與or感覺很繁瑣,現在介紹個新寫法,與大家一起進步。
select * from table where (id=1 or id=2) and price>=10;
則這條語句執行的是id=1或id=2,並且price大於等於10。等同於
select * from table where id = 1 and price >= 10 or id = 2 and price >=10;
查看有沒有安裝過: yum list installed mysql* 刪除 rpm -qa | grep mysql* 查看有沒有安裝包: yum list mysql