count group by conflict oracle sql -
for following query, got result below
select date, count(sales) table date between to_date('2015-09-01','yyyy-mm-dd') , to_date('2015-12-31','yyyy-mm-dd') group date date count(sales) 01-sep-15 480 01-sep-15 2 01-sep-15 3 01-sep-15 2 16-sep-15 12 16-sep-15 7 it should give me 2 rows-> 01-sep-15 , count(sales) 487. , 16-sep-15 , count(sales) 19 how that?
in oracle date contains time part. sql client hides not including in output. need trunc() date column set time part 00:00:00
select trunc(date), count(sales) table date between to_date('2015-09-01','yyyy-mm-dd') , to_date('2015-12-31','yyyy-mm-dd') group trunc(date)
Comments
Post a Comment