>>>> 2011/03/23 16:29 -0700, Steffan A. Cline >>>>
So, this is what I have as a basis to work on assuming I am polling
Select *, if(b.articleid=36,1,0) as checked from groups g
Left join agmap a on g.groupid=a.groupid
Left join articles b on a.articleid=b.articleid
Order by g.groupname
Why not restrict it to '36': 'WHERE b.articleid = 36'?
As for the grouping, as it says in its helptext about MySQL s permissive 'GROUP BY', the
choice for any thus allowed field --one forbidden by the standard-- is random. (It happens
I have a case where that is just what I want: I do not care which value is shown, as long
as it goes with the rest.) Maybe you want 'articleid', too, in the grouping?