0

I need to replicate the below functionality in MySQL. What will be the best way to do it?

    INSERT INTO x (id, count1, count2)
        SELECT t1.id, t1.count1, t2.count2
        FROM
            (SELECT id, COUNT(c) count1
            FROM a
            GROUP BY id) t1
        FULL OUTER JOIN 
            (SELECT id, COUNT(c) count2
            FROM b
            GROUP BY id) t2
        ON t1.id=t2.id;
Faizan Khalid
  • 125
  • 2
  • 9

0 Answers0