I want to filter the records that COMMENTS attribute is null

I have tried
SELECT TABLE_NAME, COMMENTS FROM
(SELECT TABLE_NAME, COMMENTS FROM (select * FROM user_tab_comments))
WHERE COMMENTS != null;
But it didn't return the right output. How can I do it?
NULL is a state not a value, therefore you can't use normal operators on it. Use IS NULL or IS NOT NULL instead.
SELECT TABLE_NAME, COMMENTS
FROM (SELECT TABLE_NAME, COMMENTS FROM (select * FROM user_tab_comments))
WHERE COMMENTS IS NOT NULL;
Just saw that you don't need all those subqueries
SELECT TABLE_NAME, COMMENTS
FROM user_tab_comments
WHERE COMMENTS IS NOT NULL;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With