MySQL Forums :: Newbie :: Need help with a more difficult query


Advanced Search

Need help with a more difficult query
Posted by: Rob Grubb ()
Date: February 12, 2010 06:25AM

Ive been getting along pretty well with mysql until i ran into a wall since im starting to do more advanced things.

I need to query multiple tables and not have much knowledge of joins, here is the data set.

For example how do i select only the brokers that have a market id of 2 and a type of 4. Broker market and types are in a separate table because they can have multiple values.


Table: broker
-----------------------------------------
| broker | website | charting |
------------------------------------------
| broker123 | www | yes |
------------------------------------------
| broker154 | www | no |
------------------------------------------
| broker543 | www | yes |
------------------------------------------
| broker765 | www | yes |
------------------------------------------



Table: broker_market
-----------------------
| broker | marketid |
------------------------
| broker123 | 1 |
------------------------
| broker154 | 2 |
------------------------
| broker543 | 3 |
------------------------
| broker765 | 4 |
------------------------


Table: broker_type
-----------------------
| broker | typeid |
------------------------
| broker123 | 1 |
------------------------
| broker154 | 2 |
------------------------
| broker543 | 3 |
------------------------
| broker765 | 4 |
------------------------

Options: ReplyQuote


Subject Written By Posted
Need help with a more difficult query Rob Grubb 02/12/2010 06:25AM
Re: Need help with a more difficult query nick rulez 02/12/2010 10:05AM
Re: Need help with a more difficult query laptop alias 02/12/2010 12:45PM
Re: Need help with a more difficult query nick rulez 02/13/2010 01:19PM
Re: Need help with a more difficult query Rick James 02/13/2010 02:01AM
Re: Need help with a more difficult query Rob Grubb 02/14/2010 01:23AM
Re: Need help with a more difficult query Guelphdad Lake 02/13/2010 10:12AM
Re: Need help with a more difficult query laptop alias 02/13/2010 12:55PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.