select only where 2 things are true

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

 



A
your_id
brand_id

B
brand_id
description

A is filled with this data
1-1, 1-2, 2-2, 3-1, 3-2

how to get the your_id's with description of the brand where there are more
brand_id's to a your_id

with the next query i can get the data out with a where clause, but I want
to select only the combo's

select A.your_id as id, B.description from A  left join B  on
A.brand_id=B.brand_id

what do i have to add, or do I have to use a subquery (fi so, i use mysql,
so I have to make temporary table)

so the output I want would be only 1 ( as it has two brand_id's, and 3 (
also 2 brand_id's))

thanks in advance



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