Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 one column per another column

Author  Topic 

Lulle
Starting Member

3 Posts

Posted - 2015-04-02 : 04:30:15
Hello! Im new to this and want to learn SQL =).

I playing around and was wondering how to write from a table table_order:

order_quantity per order_type

(These are of course columns)
I have a few other things to perform but want to try myself.
Thanks!

bitsmed
Aged Yak Warrior

545 Posts

Posted - 2015-04-02 : 05:05:25
[code]select order_type
,sum(order_quantity) as sum_quantity
from table_order
group by order_type[/code]
Go to Top of Page

huangchen
Starting Member

37 Posts

Posted - 2015-04-02 : 05:51:11
unspammed
Go to Top of Page
   

- Advertisement -