Reputation: 1391
How do i combine this into a single insert
INSERT INTO masterTable (count1) select count(*) as count1 from tablex
INSERT INTO masterTable (count2) select count(*) as count2 from tabley
INSERT INTO masterTable (count3) select count(*) as count3 from tablez
Upvotes: 0
Views: 36
Reputation: 13648
INSERT INTO MasterTable (count1,count2,count3)
VALUES ((select count(*) from tablex),(select count(*) from tabley),(select count(*) from tablez))
Upvotes: 1