1.
select k1,name1,k2,name2 from(select '2'as k1, 'fan' as name1) as a
left join
(select k2,name2 from(select '2'as k2, 'hui' as name2) as b) as c
on a.k1 = c.k2
2.
SELECT M.TITLE, WEEK1,w1,w2 from(
SELECT * FROM(
SELECT
'前年販売数' AS TITLE,
'' AS WEEK1,
'' AS WEEK2,
'' AS WEEK3,
'' AS WEEK4,
'' AS WEEK5,
'' AS WEEK6,
'' AS WEEK7,
'' AS WEEK8,
'' AS WEEK9,
'' AS WEEK10,
'' AS WEEK11,
'' AS WEEK12,
'' AS WEEK13,
'' AS WEEK14,
'' AS WEEK15,
'' AS WEEK16,
'' AS WEEK17,
'' AS WEEK18,
'' AS WEEK19,
'' AS WEEK20,
'' AS WEEK21,
'' AS WEEK22,
'' AS WEEK23,
'' AS WEEK24,
'' AS WEEK25,
'' AS WEEK26,
'' AS WEEK27,
'' AS WEEK28,
'' AS WEEK29,
'' AS WEEK30,
'' AS T1,
'' AS T2,
'' AS T3,
'' AS T4,
'' AS T5
) AS T1
UNION ALL
SELECT * FROM(
SELECT
'当年販売数' AS TITLE,
'' AS WEEK1,
'' AS WEEK2,
'' AS WEEK3,
'' AS WEEK4,
'' AS WEEK5,
'' AS WEEK6,
'' AS WEEK7,
'' AS WEEK8,
'' AS WEEK9,
'' AS WEEK10,
'' AS WEEK11,
'' AS WEEK12,
'' AS WEEK13,
'' AS WEEK14,
'' AS WEEK15,
'' AS WEEK16,
'' AS WEEK17,
'' AS WEEK18,
'' AS WEEK19,
'' AS WEEK20,
'' AS WEEK21,
'' AS WEEK22,
'' AS WEEK23,
'' AS WEEK24,
'' AS WEEK25,
'' AS WEEK26,
'' AS WEEK27,
'' AS WEEK28,
'' AS WEEK29,
'' AS WEEK30,
'' AS T1,
'' AS T2,
'' AS T3,
'' AS T4,
'' AS T5
) AS T2
) as M
left join
(
SELECT TITLE,w1,w2 FROM(
SELECT
'前年販売数' AS TITLE,
'1' AS W1,
'2' AS W2
) AS N
) AS N1
on M.TITLE = N1.TITLE