आप RIGHT JOIN
. का उपयोग करके ऐसा कर सकते हैं और ROW_NUMBER
. का उपयोग करके अपनी प्रत्येक तालिका को एक आईडी असाइन करें . मेरी क्वेरी नीचे देखें:
SELECT A.column1,A.column2,B.column1,B.column2 FROM
(SELECT
@row_number1:[email protected]_number1+1 AS RowNumber1,
column1,
column2
FROM Table1, (SELECT @row_number1:=0)AS x ORDER BY column1) AS A
RIGHT JOIN
(SELECT
@row_number2:[email protected]_number2+1 AS RowNumber2,
column1,
column2
FROM Table2, (SELECT @row_number2:=0)AS y ORDER BY column1) AS B
ON A.RowNumber1=B.RowNumber2