Advertisement
rAthus

Requête de recherche des événements répétés qui se terminent

May 6th, 2015
491
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.35 KB | None | 0 0
  1. SELECT *, (SELECT nom FROM bars AS b WHERE b.id=e1.id_bar) AS nom_bar FROM evenements AS e1 WHERE horaire_fin>1430690400 AND horaire_deb<1431295200 AND (SELECT COUNT(*) FROM evenements AS e2 WHERE e2.repeat_id=e1.repeat_id)>1 AND repeat_id NOT IN (SELECT repeat_id FROM evenements WHERE horaire_fin>1431295200 AND horaire_deb<1431900000) GROUP BY repeat_id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement