Ver Mensaje Individual
  #8 (permalink)  
Antiguo 10/01/2013, 13:15
Avatar de satjaen
satjaen
 
Fecha de Ingreso: septiembre-2012
Ubicación: Jaén (Andalucía)
Mensajes: 893
Antigüedad: 11 años, 8 meses
Puntos: 10
Respuesta: Consulta en varias tablas.

Cita:
Iniciado por quimfv Ver Mensaje
Insisto



Y esa { de la linea 20 y } de la linea 79 para que son?
Hola, he hecho la consulta en phpmyadmin y me da el error:

Código HTML:
Ver original
  1. Error
  2.  
  3. consulta SQL: Documentación
  4.  
  5. SELECT SUM( datos.material ) AS material ".     "
  6. FROM (
  7.  
  8. SELECT f.realizacion, f.material
  9. FROM  facturas f ".     "
  10. UNION ALL ".     "
  11. SELECT f11.realizacion, f11.material
  12. FROM  facturas_2011 f11 ".     "
  13. UNION ALL ".     "
  14. SELECT f12.realizacion, f12.material
  15. FROM  facturas_2012 f12
  16. ) AS datos ".     "
  17. WHERE datos.realizacion
  18. BETWEEN '".2011/01/01."'
  19. AND '".2011/12/31."'
  20.  
  21. MySQL ha dicho: Documentación
  22. #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 '".
  23. Â  Â  "FROM (SELECT f.realizacion,f.material FROM Â facturas f ".
  24. Â  Â  "UN' at line 1