sql中all,any,some用法實現語句,需要的朋友可以看下。
–All:對所有數據都滿足條件,整個條件才成立,例如:5大于所有返回的id
select *
from #A
where 5>All(select id from #A)
go
–Any:只要有一條數據滿足條件,整個條件成立,例如:3大于1,2
select *
from #A
where 3>any(select id from #A)
? 版權聲明
文章版權歸作者所有,未經允許請勿轉載。
THE END