Re: Howto make a double LEFT JOIN

From: Date: Sat, 06 Oct 2001 16:04:01 +0000
Subject: Re: Howto make a double LEFT JOIN
References: 1 2 3 4 5  Groups: php.db 
Request: Send a blank email to php-db+get-13067@lists.php.net to get a copy of this message
Hello, >> Okay, now that you have added a unique Primary Key to each table this >> becomes a doable task. The query to do everything you list here should be: >> >> select table1.id,bit_count(bit_or(1<<table1.sid)) as >> count1,bit_count(bit_or(1<<table3.sid)) as count2,table2.url as url from >> table1 left join table3 using(id) left join table2 using(id) group by >> table1.id; What is the best way to do if id become a sting (a-z-chars)? Best regards

« previous php.db (#13067) next »