Hi All,
Query used:
SELECT *
FROM (SELECT ooha.org_id,
ottt.name,
mp.organization\_code,
oola.attribute10,
oola.line\_id
FROM apps.oe\_transaction\_types\_tl ottt,
apps.oe\_transaction\_types\_all otta,
apps.oe\_order\_headers\_all ooha,
apps.oe\_order\_lines\_all oola,
apps.mtl\_parameters mp
WHERE ottt.transaction\_type\_id = otta.transaction\_type\_id
AND ottt.transaction\_type\_id = ooha.order\_type\_id
AND otta.transaction\_type\_id = ooha.order\_type\_id
AND ooha.header\_id = oola.header\_id
AND oola.ship\_from\_org\_id = mp.organization\_id)
pivot(COUNT(line_id)
FOR organization_code IN('A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I'))
ORDER BY org_id, NAME, attribute10;
Output:

Desired output:
