
29/04/2010, 17:30
|
Colaborador | | Fecha de Ingreso: marzo-2008 Ubicación: Cáceres
Mensajes: 3.735
Antigüedad: 16 años, 10 meses Puntos: 300 | |
Respuesta: LEFT JOIN con IF... Yo aquí usaría un UNION ALL
(SELECT Maestra.tipo, Maestra.codigo, Productos.texto FROM Maestra INNER JOIN Productos WHERE Productos.codigo = Maestra.codigo WHERE Maestra.tipo='p')
UNION ALL
(SELECT Maestra.tipo, Maestra.codigo, Familias.texto FROM Maestra INNER JOIN Familias WHERE Familia.codigo = Maestra.codigo WHERE Maestra.tipo='p') |