I have a problem with a query in SQL. I have my table pedidos
that has the fields numero pedido
, fecha recepción
and código cliente
and I need to generate a list of the clients that have not placed orders in a certain period and it occurred to me to do so:
SELECT cod_cli
FROM pedidos
WHERE NOT EXISTS
(SELECT cod_cli
FROM pedidos
WHERE fec_rep>20140809 AND fec_rep<20141010)
But when I give it to continue, I get this error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT cod_cli
FROM pedidos
WHERE fec_rep>20140809 AND fec_rep<2' at line 3
What is the error?