SELECT Client_id, first_name, mobile_number FROM client_table WHERE trim(mobile_number) IS NOT NULL
krugob8w1#
trim不会使值为null,而是使其成为空字符串
create or replace table table2 (province varchar); insert into table2 (province) values (' '), (' '); select trim(province) from table2 where trim(province,' ') = '';
https://docs.snowflake.com/en/sql-reference/functions/trim.html
yquaqz182#
如果mobile\u number的值可以是null或空格,我通常会这样做:where coalesce(trim(mobile\u number),“”)<>“”
2条答案
按热度按时间krugob8w1#
trim不会使值为null,而是使其成为空字符串
https://docs.snowflake.com/en/sql-reference/functions/trim.html
yquaqz182#
如果mobile\u number的值可以是null或空格,我通常会这样做:where coalesce(trim(mobile\u number),“”)<>“”