我想过滤 COMMENTS 属性为空的记录
我试过了
SELECT TABLE_NAME, COMMENTS FROM
(SELECT TABLE_NAME, COMMENTS FROM (select * FROM user_tab_comments))
WHERE COMMENTS != null;
但它没有返回正确的输出。我该怎么办?
答案 0 :(得分:2)
NULL
是一个非价值的州,因此您无法在其上使用普通运算符。请改用IS NULL
或IS NOT NULL
。
SELECT TABLE_NAME, COMMENTS
FROM (SELECT TABLE_NAME, COMMENTS FROM (select * FROM user_tab_comments))
WHERE COMMENTS IS NOT NULL;
只是看到你不需要所有这些子查询
SELECT TABLE_NAME, COMMENTS
FROM user_tab_comments
WHERE COMMENTS IS NOT NULL;