Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

144
Views
obtener la identificación que ha registrado todos los anuncios

Hay 3 tipos de aventuras para las que utilicé una función distinta en la consulta. Solo hay 1 cliente que ha reservado todo tipo de aventuras. La consulta que utilicé para obtener los datos es:

 select c.customerid,c.name from customer c inner join booking b on c.customerid = b.customerid inner join destination d on b.destinationid=d.destinationid inner join adventure a on d.adventureid=a.adventureid group by c.customerid having count(distinct b.bid)=(select count(*) from bid) or count(distinct a.adventuretype)=( select count(distinct a.adventuretype) from adventure )
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Puede obtener las identificaciones de los clientes mediante la agregación y having :

 select b.customerid from booking b join destination d on b.destinationid = d.destinationid join adventure a on d.adventureid = a.adventureid group by b.customerid having count(distinct a.advtype) = 3;

O, si no desea codificar el "3", puede usar:

 having count(distinct a.advtype) = (select count(distinct advtype from adventure)

Te dejaré a ti agregar el nombre del cliente (usando join , exists o in ).

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!