這裏的語句:SQL:LEFT JOIN問題,我似乎無法找出
SELECT order.order_id, order.member_id, order.date_ordered, coupon.coupon_name, coupon.coupon_type, coupon.coupon_amount
FROM order
LEFT JOIN coupon
ON order.coupon_id = coupon.coupon_id
而這裏的MySQL錯誤:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order LEFT JOIN coupon ON order.coupon_id = coupon.coupon_id' at line 2
兩個表都有一個coupon_id
。我只是不明白我做錯了什麼?
我猜「秩序」應該是反引號,因爲它是一個關鍵字 – a1ex07
也許ORDER關鍵字使問題 – vlcekmi3