On Wed, Nov 6, 2013 at 2:45 PM, Igor Tandetnik <[email protected]> wrote:

> select g_id, :mypid,
>   (case when r.p_id is null then 'no' else 'yes' end) is_member
> from g left join r on (g.g_id = r.g_id and r.m_id = :mypid);
> order by (r.p_id is null), g_id;
>

That's what I said! :)

(our posts crossed, and you're is better of course).

Nitpick: I'd put r.m_id = :mypid in a separate where clause, rather than
being on the join's ON clause. At least that's the way I'd write it (I'm
assuming it's equivalent), since it better expresses what's going on IMHO.
My $0.02. --DD
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to