SELECT id, first_name is not null as has_first_name
from users;
If you want to consider an empty string ('') as "no first name as well, you can use:
SELECT id, nullif(first_name,'') is not null as has_first_name
from users;
1
votes
SELECT id,
CASE WHEN first_name IS NULL THEN 'false' ELSE 'true' END
FROM users;
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more