Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

106
Vistas
ID repeats how do i reduce

I have two tables and a linking table between them, One of users and one of vacations and a linking table of likes, I try to bring up all the vacations that a certain user did not like And I get the same vacation twice because two other people liked her. Is there a way NSQL will bring me just one of them.

These are the users

id  u_name

1   Gabi    Ashkenazi   
2   Johnny  Tribiani    
3   Bernie  Stinson 
4   Goku    son 
5   Bo  Bennett 

These are the vacations

id  v_name

1   Venice
2   Rome
3   Maldives
4   Tokyo
5   Israel
6   Berlin
7   Prague
8   never Land

And the linking table looks like this


id  u_id   v_id
5   2       7
3   1       6
4   2       5
9   4       4

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Would something like this work for you? Find all the vacations that Johnny likes and then return the list that he doesn't like:

SELECT * 
FROM Vacations 
WHERE v_name not IN 
(
  SELECT v_name 
  FROM Users 
  JOIN Linking 
  ON Users.ID = Linking.U_id 
  JOIN Vacations On Linking.v_id = Vacations.ID
  WHERE Users.ID = 2
);
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda