- table_order
- PRODUCT_NAME
下面是SQL我要查詢table_order
這在輸出的product_id完美的作品,但我需要它顯示它的名字而不是數字。我需要用LEFTJOIN
來修改mySQL,以某種方式連接到表product_name
,但我不斷收到錯誤。因此,而不是
99 = 15,99 = 16
我需要
99 =名稱1,99 = NAME2
SELECT table_order.order_id, table_order.product_id
FROM table_order
WHERE table_order.order_id=99
ORDER BY table_order.order_product_id
table table_order
_________________________
order_id | product_id |
_________________________
99 | 15 |
99 | 16 |
_________________________
table product_name
___________________________
product_id | product_name |
___________________________
15 | name1 |
16 | name2 |
___________________________