Ver Mensaje Individual
  #3 (permalink)  
Antiguo 11/07/2012, 12:15
vani18
 
Fecha de Ingreso: junio-2010
Mensajes: 752
Antigüedad: 13 años, 10 meses
Puntos: 5
Respuesta: eliminar registro que tiene clave foranea

hola mira hice eso del join pero no me anda,...




delete
from (SELECT *
FROM factura AS f
JOIN linea AS l ON f.numero = l.nro_factura)
where cod_cliente=
(
select DISTINCT cod_cliente
from factura join entidad as e
on factura.cod_cliente=e.codigo
AND e.nombre like '%Pablo Lopez%'
)
)



dice estoo

#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 '(SELECT * FROM factura AS f JOIN linea AS l ON f.numero = l.nro_factura) wher' at line 2



QUE ERROR PUEDE HABER, ??? ES NECESARIO , CREAR UNA VISTA,,?'