如何找出string类型中的空值记录

如下一张表:

a = "a" NULL "b"
b = 1 2 3
t = table(a, b)

attachments-2021-08-jy0syJ5V610baab610de4.png

a列的数据类型是string,我想找出a中为空值的列,SQL语句如下:

select * from t where a = NULL

但是失败了,报错信息如下,请问正确SQL语句应该如何写:

Both arguments for character comparison must have the category of LITERAL
请先 登录 后评论

1 个回答

Xinhai Tang

可以进行空值数据类型的转换,例子如下:

select * from t where a=string(NULL)

结果:

attachments-2021-08-f8F4PRMu610bab6e0f18f.png

请先 登录 后评论