Re[2]: Need help with MySQL query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!
Sorry for disturbing, but, at first, this solution isn't right and,
second, I have solved this problem yet. "count (distinct blablabla)"
is turned to be right.
But thanks...
Hello Viorel,

Friday, March 5, 2004, 12:42:51 PM, you wrote:


VD> ----- Original Message ----- 
VD> From: "Mikhail U. Petrov" <mikhail@xxxxxxxx>
VD> To: <php-db@xxxxxxxxxxxxx>
VD> Sent: Friday, March 05, 2004 11:38 AM
VD> Subject:  Need help with MySQL query


>> Hi!
>> I need help with simple mysql query.
>> I have table:
>> program{
>>         program_id,
>>         partner_id
>> }
>> partner{
>>         partner_id,
>>         parnter_name
>> }
>> how I can get number of distinct partner_id's where program_id in (
>> bla bla bla)?

VD> select distinct a.partner_id, a.partner_name
VD> from partner a, program b
VD> where a.partner_id = b.partner_id
VD> and b.partner_id in (1, 2, 3)

>> Best wishes,
>> Mikhail U. Petrov.
>> 
>> -- 
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 




-- 
Best regards,
 Mikhail                            mailto:mikhail@xxxxxxxx

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux