↑看個小廣告,支持好內容↑
兩個很簡單的篩選條件,照題目做就搞定了:
id
為奇數:用 % 或是 mod 取餘數。
參考程式碼:
# 兩行的 % 是不同的功能喔
SELECT * FROM Cinema WHERE id % 2 = 1 AND description!="boring" ORDER BY rating DESC;
SELECT * FROM Cinema WHERE id mod 2 AND description NOT LIKE "%boring%" ORDER BY rating DESC;
Database
72.6%