I'm trying two insert two values (one is a select from another table with a condition) into a table ... but the below returns me an error:
SQL:
INSERT INTO animate_2 (number_records, type)
VALUES ((SELECT secty_cd, COUNT(*)
FROM securities
WHERE secty_cd = 'EQS'
), 'eqs'
);
ERROR 1241 (21000): Operand should contain 1 column(s)
The subquery works though:
mysql> SELECT secty_cd, COUNT(*) FROM securities WHERE secty_cd = 'EQS';
+----------+----------+
| secty_cd | COUNT(*) |
+----------+----------+
| EQS | 37316 |
+----------+----------+
1 row in set (0.00 sec)
What am I missing?