Summary of methods for postgresql to find fields that are empty or not empty

When using pgsql, if you want to get some data whose fields are not empty or empty, you can use the following methods:

1. Not empty

Select   *   From   table Where id<>''

Select   *   From   table Where id!=''

2. Empty

Select   *   From   table Where id=''

Select   *   From   table Where   IS NULL(id)

 

If the type of the field is a string, use id=''; if it is an int type, use IS NULL

Guess you like

Origin blog.csdn.net/quanqxj/article/details/76210419