鍍金池/ 教程/ 數(shù)據(jù)庫/ MariaDB比較運(yùn)算符
MariaDB比較運(yùn)算符
MariaDB查詢數(shù)據(jù)
MariaDB Like子句
MariaDB Sum()函數(shù)
MariaDB過程
MariaDB限制返回記錄
MariaDB Count()函數(shù)
MariaDB更新數(shù)據(jù)
MariaDB導(dǎo)出數(shù)據(jù)
MariaDB Intersect運(yùn)算符
MariaDB函數(shù)
MariaDB Min()函數(shù)
MariaDB創(chuàng)建數(shù)據(jù)庫
MariaDB Avg()函數(shù)
MariaDB刪除數(shù)據(jù)
MariaDB條件
MariaDB功能特點(diǎn)
MariaDB創(chuàng)建表
MariaDB左外連接
MariaDB Union運(yùn)算符
MariaDB安裝
MariaDB選擇數(shù)據(jù)庫
MariaDB Max()函數(shù)
MariaDB Where子句
MariaDB右外連接
MariaDB內(nèi)連接
MariaDB截?cái)啾?/span>
MariaDB Order By子句
MariaDB教程
MariaDB正則表達(dá)式
MariaDB Union All運(yùn)算符
MariaDB Distinct子句
MariaDB修改表
MariaDB刪除表
MariaDB插入數(shù)據(jù)
MariaDB From子句
MariaDB刪除數(shù)據(jù)庫
MariaDB簡介
MariaDB數(shù)據(jù)類型

MariaDB比較運(yùn)算符

MongoDB比較運(yùn)算符用于測試等于或不等于,還有其它更高級(jí)的運(yùn)算符。

WHERE子句中使用比較運(yùn)算符來確定要選擇的記錄。以下是可以在MariaDB中使用的比較運(yùn)算符的列表:

語法及示例 -

編號(hào) 比較運(yùn)算符 描述 示例
1 = 比較等于 select * from students where id=100
2 <=> 比較等于(安全比較NULL值) select * from students where student_name<=>'Maxsu'
3 <> 比較不等于 select * from students where student_name<>'Maxsu'
4 != 比較不等于 select * from students where student_name!='Maxsu'
5 > 比較大于 select * from students where student_id>5
6 >= 比較大于或等于 select * from students where student_id>=5
7 < 比較小于 select * from students where student_id<5
8 <= 比較小于或等于 select * from students where student_id<=5
9 in ( ) 匹配列表中的值 select * from students where student_id IN(1,3,6)
10 not 否定一個(gè)條件 select * from students where student_id NOT IN(1,3,6)
11 between 匹配在一個(gè)范圍內(nèi)(含) select * from students where student_id between 1 AND 3)
12 is null 判斷是否為NULL select * from students where student_address IS NULL
13 is not null 判斷是否為非NULL select * from students where student_address IS NOT NULL
14 like %_模式匹配 select * from students where student_name LIKE 'Ma%'
15 exists 如果子查詢返回至少一行,則滿足條件。