List:General Discussion« Previous MessageNext Message »
From:Colin McKinnon Date:November 2 1999 1:49pm
Subject:Re: in one query
View as plain text  
At 10:24 02/11/99 +0100, Jan Dvorak wrote:
>Hi,
>
>I know of no other option than going through a temporary table.
>You will have to send several queries to MySQL.
<snip>

I'm feeling very smug - I know how to do it.

SELECT ban_user.name, sum(not(isnull(ban_ners.id)))
        FROM ban_user LEFT JOIN ban_ners ON (ban_user.id = ban_ners.uid)
        GROUP BY ban_user.name;

(I haven't tested to make sure the join is the right way round - but get
the idea?)

Colin


Thread
in one queryPhilips2 Nov
  • Re: in one queryJan Dvorak2 Nov
    • Re: in one queryBob Kline2 Nov
      • Re: in one queryPhilips2 Nov
        • Re: in one queryBob Kline2 Nov
          • Re: in one queryBob Kline2 Nov
    • Re: in one queryColin McKinnon2 Nov