hello can I use select inside if statement like :
begin if (select count(*) from employees) >= 15 then do something; end if; end;
note : I want to delete rows from table where above condition evaluates with true
Sign Up to our social questions and Answers to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers to ask questions, answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
hello Beter,
you can’t use SQL Statement directly in a PL/SQL expression instead you can use variable to store your count then use your variable into PL/SQL expression like this :
or as you mentioned if you want to use it inside delete statement like this :
hope this helpful 🙂