I'm trying to run this query, and it always gives me the following error:
1060 - Duplicate column name 'NULL'
INSERT INTO ce_coins_issued (idc, idu, year, ltr, issuing, status)
SELECT * FROM (SELECT 2,1,2002,NULL,NULL,'wallet') AS tmp
WHERE NOT EXISTS
(SELECT idc, idu, year, ltr, issuing, status FROM ce_coins_issued
WHERE idc = 1 AND year = 2002 AND ltr = NULL LIMIT 1)
The table is allowing fields to be NULL, since they have given permission. So I realized, what makes this error is to have two NULL's in the SELECT, because if you remove one of them, the query already executes without problems.
Can you help why?