Estoy haciendo un query que me dice cuantas veces hoy fue ingresado un producto por id, pero me sale un error cuando intento realizar la búsqueda sobre dos columnas, en cambio si lo hago sobre una queda bien.
Este sale bien: -------------------------------------------------------------------- query = "SELECT COUNT(*) FROM tienda_registro WHERE fecha_servidor = '2013-01-22'" -------------------------------------------------------------------- Este que consulta el conteo usando dos columnas sale mal -------------------------------------------------------------------- query = "SELECT COUNT(*) FROM tienda_registro WHERE id_producto = 65656 , fecha_servidor = '2013-01-22'" Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute self.errorhandler(self, exc, value) File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler raise errorclass, errorvalue _mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' fecha_servidor = '2013-01-22'' at line 1") -------------------------------------------------------------------- Alguien me podría decir que esta mal? Gracias. -- *Diego Alonso Uribe Gamez* ------------------------------ *Desarrollador web* Twitter: @DiegoUG <http://www.twitter.com/DiegoUG> Google+: http://gplus.to/diegoug ------------------------------
_______________________________________________ Python-es mailing list Python-es@python.org http://mail.python.org/mailman/listinfo/python-es FAQ: http://python-es-faq.wikidot.com/