misi gan,

gini,

saya sudah nampilin data kya gini :

3701

saya pengen nampilin data kya gini :

3702

terimakasih. . .

udah SOLVED gan,

kita main di query nya ajah,hehehe. . . .

Contoh Querynya gimana gan ?

begini gan, kasus saya ambil data dari 2 tabel dan fieldny pun gak berubah, jadi di bikin view ajah. . .hehehe

``````

CREATE OR REPLACE VIEW view_penyusutan_gol_per_tahun

AS

SELECT G.kd_gol, G.ur_gol,

SUM(IF(thn_ang='2006',FLOOR(M.rph_aset),0)) AS 'thn_2006',

SUM(IF(thn_ang='2007',FLOOR(M.rph_aset),0)) AS 'thn_2007',

SUM(IF(thn_ang='2008',FLOOR(M.rph_aset),0)) AS 'thn_2008',

SUM(IF(thn_ang='2009',FLOOR(M.rph_aset),0)) AS 'thn_2009',

SUM(IF(thn_ang='2010',FLOOR(M.rph_aset),0)) AS 'thn_2010',

SUM(IF(thn_ang='2011',FLOOR(M.rph_aset),0)) AS 'thn_2011',

SUM(M.rph_aset) AS Total

FROM dbbmn10.t_masterhm M, t_gol_umeko G

WHERE G.kd_gol = SUBSTR(M.kd_brg,1,1)

AND M.thn_ang != '0'

GROUP BY G.ur_gol

ORDER BY G.kd_gol ASC

``````

Semoga bisa membantu gan, , ,

CMIIW

Makasih Gan