Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT * FROM utenti u
- LEFT JOIN accessi_buoni b1 ON b1.id_utente = u.id AND b1.buono = 1 AND b1.id_mese = 6
- LEFT JOIN accessi_buoni b2 ON b2.id_utente = u.id AND b2.buono = 2 AND b2.id_mese = 6
- LEFT JOIN risposte_utenti r1 ON r1.id_utente = u.id AND r1.id_domanda = (
- SELECT id FROM domande WHERE id_mese = 6 LIMIT 0,1
- )
- LEFT JOIN risposte_utenti r2 ON r2.id_utente = u.id AND r2.id_domanda = (
- SELECT id FROM domande WHERE id_mese = 6 LIMIT 1,1
- )
- LEFT JOIN risposte_utenti r3 ON r3.id_utente = u.id AND r3.id_domanda = (
- SELECT id FROM domande WHERE id_mese = 6 LIMIT 2,1
- )
- LEFT JOIN risposte_utenti r4 ON r4.id_utente = u.id AND r4.id_domanda = (
- SELECT id FROM domande WHERE id_mese = 6 LIMIT 3,1
- )
- LEFT JOIN domande d ON d.id = r.id_domanda
- LEFT JOIN punti p ON p.codice_ce = u.codice AND p.id_mese = 6
- WHERE 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement