need changes in sql output
I need some changes in result as below... the current query provide me output as below and also i mention here what i need as output.
Please refer excel sheet, which is attached with this thread. filename : sql_change.xls
SQL QUERY
====================
SELECT
option_type_id,
option_type,
option_description,
module_type,
static_option_mapping,
parent_option_id,
purchased_option_id,
release_type,
pool_id,
pool_name,
SUM(access_type_count) total_option_count,
availablecount,
DECODE(access_type, 'SC', assignedcount) sc_assigned,
DECODE(access_type, 'SO', assignedcount) so_assigned,
DECODE(access_type, 'SC', availablecount) sc_availablecount,
DECODE(access_type, 'SO', availablecount) so_availablecount,
0