Re: Need help with MySQL query

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

 



----- Original Message ----- 
From: "Mikhail U. Petrov" <mikhail@xxxxxxxx>
To: <php-db@xxxxxxxxxxxxx>
Sent: Friday, March 05, 2004 11:38 AM
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)?

select distinct a.partner_id, a.partner_name
from partner a, program b
where a.partner_id = b.partner_id
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
> 

-- 
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