ERROR 1136 - driving me nuts
Date: November 03, 2005 01:48PM
I've been trying to debug this stored procedure the whole evening, and I have no more ideas. Please help me, I am sure it's something I am overseeing. The error I am receiving is:
ERROR 1136 (21S01): Column count doesn't match value count at row 1
Here is my code. Where is the problem??? Thank you a lot.
CREATE PROCEDURE test ()
DECLARE i INT;
SET i = 0;
SELECT COUNT(DISTINCT network.MAC) AS total_mac FROM network;
SELECT MAC, AVG(RX) as avg_rx, AVG(TX) as avg_tx, AVG(SNR) as avg_snr, AVG(RTT) as avg_rtt from network WHERE ((TX > 1) AND (RX > 1) AND (SNR BETWEEN 5 AND 50)) GROUP BY MAC;
INSERT INTO network_hour (MAC, rx, tx, snr, rtt) values(MAC, avg_rx, avg_tx, avg_snr, avg_rtt);
SET i = i+1;
UNTIL i >= total_mac
Edited 1 time(s). Last edit at 11/03/2005 01:48PM by Mircea Stoinescu.