在使用pgsql时,想要取到某些字段不为空或者为空的数据,可以用以下方法:1、不为空Select * From table Where id<>'' Select * From table Where id!=''2、为空Select * From table Where id='' Select * From table Where ISNULL(id)如果字段是类..
注意!!!select * from user where uid not in (a,b,c,null);这个sql不回返回任何结果。要避免not in的list中出现null的情况。另外:–如果null参与算术运算,则该算术表达式的值为null。(例如:+,-,*,/ 加减乘除)–如果null参与比较运算,..
#字符串拼接 concat(s1,s2); 将表中last_name和first_name中的字符串拼接select concat(last_name,first_name) as 姓名 from employees;#只会修改last_name不会修改first_nameSELECT first_name,last_name AS f FROM employees;#将两个列用逗号隔开..
复制代码 代码如下: -判断某些字段是否为空 --case select case when '字段名' is null then '\N' else convert(varchar(20),'字段名') end as 'NewName' select case when null is null then '\N' else convert(varchar(20),null) end as 'NewName..