How to get last 3 months records from the table.
SELECT *
from table
where month > CURRENT_DATE-120
and month < CURRENT_DATE
order by month;
I have used the above query is it correct? shall I use this for get last 3 month record from the table.
You can use built-in
INTERVALinstructionCheck how this works:
and you can rewrite your SQL to:
(not checked but this should give you an idea how to use INTERVAL instruction)