Mysql SELECT nested query, very complicated?

Posted by smartbear on Stack Overflow See other posts from Stack Overflow or by smartbear
Published on 2009-10-21T08:32:11Z Indexed on 2010/03/25 15:03 UTC
Read the original article Hit count: 389

Filed under:
|
|
|
|

Okay, first following are my tables:

Table house:

id | items_id |

1 | 1,5,10,20 |


Table items:

id | room_name | refer

1 | kitchen | 3

5 | room1 | 10


Table kitchen:

id | detail_name | refer

3 | spoon | 4

5 | fork | 10


Table spoon:

id | name | color | price | quantity_available |

4 | spoon_a | white | 50 | 100 |

5 | spoon_b | black | 30 | 200 |

How to do a nested select statement, where I want to select id, name, color, price and quantity_available column, from the each value inside the 'items_id' column in 'house' table?

This is very challenging!!

EDIT:

after read robin's answer

Table house:

id | items_id |

house1 | 1 |

house1 | 5 |

house1 | 10 |

house2 | 20 |

If this it the house table, how to do the nested, join, or whatever select statement??

© Stack Overflow or respective owner

Related posts about mysql

Related posts about query