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

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -