Oracle sql return true if exists question

后端 未结 5 1311
清酒与你
清酒与你 2021-01-03 21:12

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

  • user_id
  • user_password
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-03 21:42

    Or you could do this:

    select decode(max(USER_ID), null, 'FALSE', 'TRUE') BOOL_VAL
    from USER_TABLE where USER_ID = [some USER_ID here]
    

提交回复
热议问题