oracle - the right command to select the number of products of every client that had a purchase in the last month -


oracle question i've go table

com (clientnumber,productnumber,dateofpurchase ) ; want know how compare dates using sysdate , date of purchase know 1 happened last month

i think 1 can solve problem

select * com dateofpurchase between trunc((trunc(sysdate,'mm')-1),'mm')  , trunc(sysdate,'mm')-1  trunc((trunc(sysdate,'mm')-1),'mm') -->  last_month_fist_day trunc(sysdate,'mm')-1               -->  last_month_last_day 

Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -