SQL to determine whether the field is empty

Determining whether the field is empty sql

When sql statement query condition, sometimes determine whether a field is empty.

Empty the contents of the field for the two cases

  1. null

  2. empty string ''

Statement is as follows:

select * from table where column is null or trim(column)=''

This may eliminate the field contents is null, '' a.

 

Determine if a field is not empty

select * from table where trim(column) != ''

I tried to determine null: is not null, but does not work, give up. . . Direct trim (column)! = '' Can be solved.

Guess you like

Origin blog.csdn.net/m0_37787662/article/details/90544304