Skip to content
Advertisement

Convert column to row and sum query in different table

i trying to figure to convert sumtchtraffic and totalpayloadGb column in sitetable and sum data totalpayloadGb & sumtchtraffic where BTS_TYPE 2g, 3g and 4g in techtable

i tried like this, but i cant show totalpayloadgb & sumtchtraffic in column [SUM OF] ([sum of] is not in any table in my database)

I want show my data like this: I want show my data like this

Advertisement

Answer

One way would be to total your results separately, using the same conditional aggregation you have started, and then UNION the results together. Since your first column doesn’t exist anywhere else, you’ll have to hard-code it into the queries.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement