I have two variable TO_DATE and FROM_DATE. My table has two fields DOJ and DOL. I want to select all the records where DOJ < TO_DATE and DOL > FROM_DATE.
How can I write an SQL query in for this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine 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.
You might run into troubles with the variable named to_date, since that is a built-in Oracle command. You can work around that using double quotes wherever the variable is used, like this: