How do I check if a particular element exists in a table - how can I return true or false?
I have a table that has
There is no Boolean type in Oracle SQL. You will need to return a 1 or 0, or some such and act accordingly:
SELECT CASE WHEN MAX(user_id) IS NULL THEN 'NO' ELSE 'YES' END User_exists FROM user_id_table WHERE user_id = 'some_user';