I have two tables named stockin and stockout. I can execute query easily separately for each table. Now, I want to bind both query in a table. Please check query and output below-

query in stockin:
Code:
select serialno, sum(in_quantity) SUMIN, group_concat(in_quantity) GCIN from stockin group by stockin.serialno
output:
Code:
+----------+-------+-------------+
| serialno | SUMIN | GCIN        |
+----------+-------+-------------+
| AAA1     |   800 | 500,200,100 |
| AAA2     |   500 | 500         |
| AAA3     |     3 | 1,1,1       |
+----------+-------+-------------+
3 rows in set (0.00 sec)
query in stockout:
Code:
select serialno, sum(out_quantity) SUMOUT, group_concat(out_quantity) GCOUT from stockout group by stockout.serialno
output:
Code:
+----------+--------+-------------------------+
| serialno | SUMOUT | GCOUT                   |
+----------+--------+-------------------------+
| AAA1     |    740 | 300,100,50,50,20,20,200 |
| AAA3     |      3 | 1,1,1                   |
+----------+--------+-------------------------+
2 rows in set (0.00 sec)
Now, I would like to create a report as belows-

Code:
+----------+-------+-------------+----------+--------+-------------------------+
| serialno | SUMIN | GCIN        | serialno | SUMOUT | GCOUT                   |
+----------+-------+-------------+----------+--------+-------------------------+
| AAA1     |   800 | 500,200,100 | AAA1     |    740 | 300,100,50,50,20,20,200 |
| AAA2     |   500 | 500         | (NULL)   |  (NULL)| (NULL)                  |
| AAA3     |     3 | 1,1,1       | AAA3     |      3 | 1,1,1                   |
+----------+-------+-------------+----------+--------+-------------------------+
3 rows in set (0.00 sec)