I need to print records which have the current calendar month as the enrolled month.
sysdate for this function. But, I'm not sure if that is correct or not.
My code would be,
select * from student where sysdate,trunc('mm') = enrolled_month;
I just need some way to print current month using
Any kind of help will be appreciated.
Thanks in advance.
Here is another option using
SELECT * FROM student WHERE TO_CHAR(sysdate, 'Month') = enrolled_month;
But I don't think it's a good idea to store the enrollment month name (and perhaps the other components) separate from the enrollment date. Just store the date once, and then use Oracle's date functions to work that data.