在使用pgsql时,想要取到某些字段不为空或者为空的数据,可以用以下方法:
1、不为空
Select * From table Where id<>''
Select * From table Where id!=''
2、为空
Select * From table Where id=''
Select * From table Where ISNULL(id)
如果字段是类型是字符串,用 id=''可以;如果是int型则用 ISNULL
如果需要将空值设置为其它值:
select COALESCE(b.price, 其它值) as price from fruit_sale b
除此之外,一般会用到在pgsql中设置id自增
工具:navcicat
函数
uuid_generate_v4()
如下:
效果图:
pgsql有时候在表的操作上会出现比较慢的情况,需要点耐心