sql server - How to group the rows and move them into new column in the same table? -


i want group rows , move them new column in same table. here ilustration: table ilustration

and query i've made far:

select      month([date]) bulan,      [type] tipe,     sum([net qty]) total_karton,      cast(sum([cm1 (rp)]) decimal) total_uang      tbl_weeklyflash_id     datediff(month,[date],current_timestamp) between 0 , 2 group      month([date]),     [type] order      month([date]), [type] 

how that?

you want pivot - there's example @ http://www.mssqltips.com/sqlservertip/1019/crosstab-queries-using-pivot-in-sql-server-2005/


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -