MySQL Forums
Forum List  »  Newbie

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
February 12, 2010 06:25AM


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.