tags:

views:

27

answers:

1

i have 2 tables one market, another brand , so when a client search for a brand i need to return all the markets where he can find that brand.

A: 

assuming your dd looks like this:

market(id, name)

brand(id, name)

market_brand(fk_market_id, fk_brand_id)

your query would look something like this:

select m.name
  from brand b
  join market_brand mb on mb.fk_brand_id = b.id
  join market m on m.id = mb.fk_market_id
 where b.name = 'your_brand'
Dennis Haarbrink
thanks you've been very helpfull
decebal
@user392502: Absolutely. Can't help you with that though, don't know any python. You should ask another question to get that answered :)
Dennis Haarbrink