0

I have table that contains data like this:

add_ser       add_date          customer_name
1               16/02/2018           asd
1               16/02/2018           asd
1               16/02/2018           asd
2               16/03/2018           qwe
2               16/03/2018           qwe
3                16/03/2018          asd
4                15/4/2018           zxc
4                15/4/2018           zxc

I want to run SELECT statement with GROUP BY add_ser, but this code returns with an error:

cmd.CommandText = "select add_ser,customer_name,add_date from add_items GROUP By add_ser" 
evry1falls
  • 194
  • 4
  • 15
  • 4
    please add what error you got. – dkb Feb 18 '19 at 07:42
  • Your query does not include the specified expression 'customer_name' as part of an aggregate function. – Mahmoud Fathy Feb 19 '19 at 13:29
  • Does this answer your question? [Using group by on multiple columns](https://stackoverflow.com/questions/2421388/using-group-by-on-multiple-columns) – evry1falls May 26 '20 at 17:00
  • https://stackoverflow.com/questions/13999817/reason-for-column-is-invalid-in-the-select-list-because-it-is-not-contained-in-e – NDJ May 27 '20 at 08:08

0 Answers0