sql - how make query about some of a field are equal? -


i'm trying code below

select sum(price) faktor date=date 

but shows total of price. want show sum of per day like:

date ----- sum 2015/5/1  12345 2015/5/2  54124 

i have tried below code error:

select date,sum(price) faktor date=date 

[err] 42000 - [sql server]column 'faktor.date' invalid in select list because not contained in either aggregate function or group clause.

try

select [date],sum([price]) faktor group [date] 

not sure why you'd use date=date, left out.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -