日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

sql語句:and與or的優先級

作者:黃佳俊、 更新時間: 2022-02-04 編程語言

and的優先級大于or 我這里寫大括號方便區分,表示兩個條件或兩個條件 可以省略括號
?

select device_id,gender,age,university,gpa from user_profile
where (university='山東大學' and gpa>3.5 )
or (university="復旦大學" and gpa>3.8);

等效于

select device_id,gender,age,university,gpa
from user_profile
where university='山東大學' and gpa>3.5 or university='復旦大學' and gpa>3.8

原文鏈接:https://blog.csdn.net/weixin_48419914/article/details/122278971

欄目分類
最近更新