i once wanted to to this:
SELECT events.b_g FROM events WHERE events.b_g NOT IN ( SELECT otf.b_g FROM otf ) AND events.b_g NOT IN ( SELECT requests.b_g FROM requests)
and this...
... WHERE events.b_g IN ( SELECT otf.b_g FROM otf ) OR events.b_g IN ( SELECT requests.b_g FROM requests ) ...
instead i had to do this:
SELECT events.b_g, events.vector, SUM(tries) AS 'attempts', COUNT(DISTINCT events.observer) AS 'reporters' FROM events LEFT JOIN otf ON events.b_g = otf.b_g LEFT JOIN requests ON events.b_g = requests.b_g WHERE requests.b_g IS NULL AND otf.b_g IS NULL GROUP BY events.b_g, events.vector ORDER BY events.b_g, events.vector, 'attempts'
and...
... WHERE requests.b_g = events.b_g OR otf.b_g = events.b_g ...
this might or might not help.
In reply to Re: DBI question with placeholders and IN
by zengargoyle
in thread DBI question with placeholders and IN
by dragonchild
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |