How can I count total rows from different tables and insert them into a column of a result table. In MySQL
Insert into hospitals(total_case)
Select count(*)
Id, count (id)
From Islamabad
How can I count total rows from different tables and insert them into a column of a result table. In MySQL
Insert into hospitals(total_case)
Select count(*)
Id, count (id)
From Islamabad
Number of columns in INSERT INTO
statement should match with number of columns selected in SELECT
clause.
You have selected two columns count(*) Id, count (id)
but want to insert in single column total_case
which would create an error.
INSERT INTO hospitals (total_case)
SELECT COUNT(id)
FROM Islamabad;