Giuseppe Costanzi wrote:
> order_id    issued        company   dep_id  qty,    dispatch   surplus
> "1"        "12-11-2013"  "Siemens"  "1"     "6"    "4"        "2"
> "1"        "12-11-2013"  "Siemens"  "1"     "2"    "2"        "0"
> "2"        "13-11-2013"  "Siemens"  "2"     "10"   "10"       "0"
> "3"        "13-11-2013"  "Siemens"  "8"     "3"    "3"        "0"
>
> How I can group by order_id?

By writing "group by order_id".

> In the example I'would return on order_id =1:
>
> order_id    issued        company   dep_id  qty,    dispatch   surplus
> "1"        "12-11-2013"  "Siemens"  "1"     "8"    "6"        "2"

Also add SUM(...) where needed.


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to