Assuming the following table definition...
SQL> desc mytable
Name Null? Type
------- -------- -----------
REF_NO NUMBER(3)
L_CODE VARCHAR2(3)
AMOUNT NUMBER(8)
And having the following data in the table...
SQL> select * from mytable;
REF_NO L_C AMOUNT
--------- --- ---------
126 IHP 10000
126 LTE 5000
127 IHP 6000
127 IHI 7000
The following query, using the DECODE operator, is a fairly simple,
straightforward, extenisble solution to creating a crosstab report...
SELECT ref_no,
SUM( DECODE(l_code, 'IHP', amount, 0) ) "IHP",
SUM( DECODE(l_code, 'LTE', amount, 0) ) "LTE",
SUM( DECODE(l_code, 'IHI', amount, 0) ) "IHI"
FROM mytable
GROUP BY ref_no;
Which yields the results...
REF_NO IHP LTE IHI
--------- --------- --------- ---------
126 10000 5000 0
127 6000 0 7000