title: SQL - result of Stored Procedures
body: <p>I have two tables and A and B and i have a third table with result of join A and B,i use mariadb database, i want to store result in the third table result_A_B but I have this message when i run "CALL session_cpu_procedure()": ERROR 1136 (21S01): Column count doesn't match value count at row 1</p>
  
  <pre><code>CREATE TABLE result_A_B (
  ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
  cid nvarchar(100) NOT NULL, 
  time datetime NOT NULL,
  OS nvarchar(100) NOT NULL, 
  program nvarchar(100) NOT NULL,
  nb_OS_by_program FLOAT NOT NULL,
  cpu FLOAT,
  last_line int NOT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY (`cid`,`time`,`program`) ) ENGINE=InnoDB;
  
  
  DELIMITER |
  CREATE PROCEDURE session_cpu_procedure()
  BEGIN
  TRUNCATE result_session_cpu_CPLSVFX201P;
  INSERT INTO result_session_cpu_CPLSVFX201P
  SELECT DISTINCT C.cid,  C.time, C.OS, C.program, COUNT(*) as nb_OS_by_program, O.cpu, C.last_line 
  FROM session_test C LEFT outer JOIN cpu_test O ON O.sid2 = C.cid and O.time = C.time and C.PROGRAM=O.MODULE 
  where C.time
  GROUP BY C.time, C.OS, C.program, C.last_line;
  END |
  DELIMITER ;
  
  CALL session_cpu_procedure();
  </code></pre>
  
  <p>I want to know how to resolve this error: ERROR 1136 (21S01): Column count doesn't match value count at row 1, thanks for any response</p>