空字符串与NULL 首先有如下代码 SELECT * FROM Pdc_DataDomain DD INNER JOIN Pdc_DD_Table DDT ON DD.DataDomainID = DDT.DataDomainID AND DD.ApplicationDBID = '3e7c6764d73f4c7786c99e5b72eb6912' AND DDT.TableName <> '#' AND NOT EXISTS (SELECT * FROM pdc_Application_3e…
简述 cola in (x,y,z)等价于 cola=x or cola=y or cola=z cola not in (x,y,z)等价于 !(cola=x or cola=y or cola=z) 等价于 cola!=x and cola!=y and cola!=z 再说 cola=null和cola!=null,这两个表达式的结果都是false 然后就能看出来 cola in (x,y,...,z,null) 等价于 cola in (x,y,...,z)意思就是多你一个不多反正是 c…
select * from dual order by age desc nulls last select * from test order by age asc nulls first sqlserver 认为 null 最小. 升序排列:null 值默认排在最前. 要想排后面,则:order by case when col is null then 1 else 0 end ,col 降序排列:null 值默认排在最后. 要想排在前面,则:order by case when col…