Skip to content
Advertisement

display all the 1year back from current data in the table in db2

this is my table. i want to extract records of last 1 year from current date. so my output should be

Advertisement

Answer

In the WHERE clause set the condition that dob is greater than the current date minus 1 year:

If you want all the rows of the current and the previous year:

See the demo.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement