我有點新來的MySQL,所以我不知道如何使querys加入多個表,所以我需要一些幫助使這個查詢。多表查詢 - SQL
所以我有這些表:
產品
| id | category | description | brand |
|:-----------|------------:|:------------:|:------------:|
| 1 | desktops | Hp example| HP |
| 2 | laptops | asus example| ASUS |
房屋
| id | location | Brands(physical stores) |
|:-----------|------------:|:-----------------------:|
| 1 | liverpool| currys |
| 2 | london | novatech |
| 3 | bristol | novatech |
products_stores
| id_product | id_store | price |
|:-----------|------------:|:-------:|
| 1 | 2 | 700 |
| 2 | 3 | 400 |
| 2 | 1 | 300 |
所以,我要查詢來獲取數據,並組織其喜歡這個( suposing我想所有數據):
| category | description | brand | store | location | price |
|:------------|-------------:|:------------:|:------------:|:----------:|:---------:|
| desktops | Hp example| HP | novatech | london | 700 |
| laptops | asus example| ASUS | novatech | bristol | 400 |
| laptops | asus example| ASUS | currys | liverpool | 300 |