为什么这个INNER JOIN不起作用?

时间:2017-05-20 09:42:37

标签: php sql database inner-join

我正在尝试INNER JOIN'order'表和'customer'表但它不起作用。常见字段是'cus_id'。这是我的INNER JOIN代码:

SELECT *
FROM customer
INNER JOIN order ON customer.cus_id = order.cus_id;

'客户'表 'customer' table

'订单'表 'order' table

1 个答案:

答案 0 :(得分:1)

订单是mysql的关键词。使它被后面的刻度所包围

  SELECT *
  FROM customer
  INNER JOIN `order` ON customer.cus_id = order.cus_id;