SQL SELECT Previous MMYY as varchar(4)

后端 未结 3 618
滥情空心
滥情空心 2021-01-17 06:32

Dearest genius StackOverflow friends,

I\'m in the need of creating a view that will always give me data in the WHERE clause for \"Period\" looking for the previous M

3条回答
  •  不要未来只要你来
    2021-01-17 06:46

    you can get what you want using

    TO_CHAR(add_months(sysdate,-1), 'MMYY')

    of course you can replace sysdate with timestamp, if necessary.

提交回复
热议问题