Ver Mensaje Individual
  #4 (permalink)  
Antiguo 18/11/2005, 16:35
Avatar de haron
haron
 
Fecha de Ingreso: febrero-2004
Ubicación: Cádiz (refinitivo)
Mensajes: 632
Antigüedad: 20 años, 2 meses
Puntos: 3
hay formas de evitar las subqueries.
Código:
select *
from Jugadores
WHERE ID >'10'
and ID NOT IN (Select idjugador FROM Partidos WHERE idpartido = '1')
se puede sustituir por

Código:
select j.*
from Jugadores j
left join Partidos p
  on p.idpartido = '1'
  and p.idjugador = j.id
where j.id >'10'
and p.idpartido is null
__________________
Si ocurre algo importante, estamos afuera fumándonos unos cigarritos.