sql >> Database >  >> RDS >> Mysql

wederzijdse vriend sql integratie complexe vraag

event_id =1 en uw gebruikers-ID =1

SELECT u.*
FROM wp_fd_subscriptions AS s
JOIN wp_fd_users AS u 
   ON s.event_user_id = u.id
LEFT JOIN wp_fd_matches m1 
   ON m1.event_id = s.event_id 
   AND m1.event_user_id = 1
   AND m1.event_user_match_id = s.event_user_id
LEFT JOIN wp_fd_matches m2
   ON m1.event_id = m2.event_id 
   AND m2.event_user_id = m1.event_user_match_id
   AND m2.event_user_match_id = 1
WHERE s.event_id=1 AND u.id != 1 AND m2.id IS NULL;


  1. Querygroep per paar kolomresultaat

  2. Hoe stel ik ASP.NET MVC 2 in met MySQL?

  3. DBaaS, cloud en transparante queryrouting

  4. mysql-tabel vergrendeld nadat php crasht