List:General Discussion« Previous MessageNext Message »
From:Reindl Harald Date:March 31 2011 5:56pm
Subject:Re: Select with counts of matching rows from another table...
View as plain text  
Am 31.03.2011 17:53, schrieb S?ndor Hal?sz:
>>>>> 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
> article #36.
>  
> 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?

instead of writing me since weeks private mails that you do not want
gpg-signed mails and how hard it is for you to not ignore .asc-attachments
you should learn to use your mail-client and how to quote answers

original-text followed by <<<<<<<< is NOT quoting!


Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Thread
Select with counts of matching rows from another table...Steffan A. Cline24 Mar
  • Re: Select with counts of matching rows from another table...hsv31 Mar
    • Re: Select with counts of matching rows from another table...Reindl Harald31 Mar