MySQL---exists檢查數據庫對象是否存在
#25/檢查數據庫對象是否存在:先執行子查詢在執行子查詢外
#exists 檢查數據庫對象是否存在
#not exists 檢查數據庫對象是否不存在
#in 包含 NOT 不包含
#is null 判斷是否爲空
#is not null 判斷是否不爲空
#
select * from score #查詢成勣表
WHERE #查詢條件
EXISTS #檢查數據庫對象是否存在,
(SELECT num FROM score WHERE num>80);#num>80的值存在與成勣表,爲true,則顯示表數據,如果不存在,則爲false,爲空
0條評論