Topic: query union dan inner join

halo all. saya masih baru di forum ini. saya mau minta tolong dong. kenapa query saya ini tidak bisa ya.

select d.Periode, d.Cust_ID, d.SPG_ID, d.PG, d.Target_Qty, k.NAME1, Target_HO, SPG_Name, right(d.Cust_ID,6),p.nomor
FROM (((((select Periode, SPG_ID, Cust_ID, PG from spg_master_target_detail union select Periode, SPG_ID, Cust_ID, PG from spg_item_wm_ac) d inner join (select KUNNR, NAME1 from kna1 union select KUNNR, NAME1 from spg_kna1_exception) k on d.Cust_ID = k.KUNNR)
inner join spg_master_target_header h on h.Periode = d.Periode and h.Cust_ID = d.Cust_ID)
inner join spg_master m on m.SPG_ID = d.SPG_ID)
inner join spg_master_sys_parameter p on d.PG = p.value)
where p.Parameter = 'PG' and m.cabang = 'Semarang' and d.Periode = 'Aug - 2013' order by d.Periode, d.Cust_ID, d.SPG_ID, p.nomor;

muncul error nya :

Error Code : 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') d inner join (select KUNNR, NAME1 from kna1 union select KUNNR, NAME1 from spg' at line 2

apakah memang tidak boleh 2 union dalam 1 query ?

mohon pencerahannya