我有我的店铺数据库,我想一起加入两张桌子。如何将列添加到基于一列的另一个表中?
id_order | reference | id_shop_group | id_shop | id_carrier | id_lang | id_customer | id_cart
这是我orders
表的标题行和下面是customers
表的标题。
id_customer | id_shop_group | id_shop | id_gender | firstname | lastname
我想要做的是加入他们根据id_customer
列。更具体地说,我想添加customers
的所有列,除了那些已经存在的列以orders
表为基础的id_customer
。连接表后应该是这样的:
id_order|reference|id_shop_group|id_shop|id_carrier|id_lang|id_customer|id_cart|id_gender|firstname|lastname
当一个解决方案搜索,我发现INNER JOIN
关键字,但我不知道如何使用它,我想要的方式。