SELECT Q as QBSI, 0 AS QBSN, 0 AS QALI,0 AS QALN,0 AS QDSI,0 AS QDAN,0 AS QGAI,0 AS QGAN from Р1
union all select 0, Q ,0,0,0,0,0,0 from Р2
union all select 0, 0,Q ,0,0,0,0,0 from Р3
union all select 0, 0,0,Q,0,0,0,0 from Р4
union all select 0,0,0,0,Q,0,0,0 from Р5
union all select 0,0,0,0,0,Q,0,0 from Р6
UNION ALL select 0,0,0,0,0,0,Q,0 from Р7
UNION ALL select 0,0,0,0,0,0,0,Q from Р8; |