how to use join query to merge order,customer,category and product table?
-
SELECT ord.orderid,cus.custid,cus.custname,cat.catid,cat.catname,pro.proid,pro.proname from 'order' as ord inner join 'customer' as cus on cus.custid=ord.custid inner join 'category' as cat on cat.catid=ord.catid inner join 'product' as pro on pro.proid=ord.proid #1064 - 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' as ord inner join 'customer' as cus on cus.custid=ord.custid inner join' at line 1
-
SELECT ord.orderid,cus.custid,cus.custname,cat.catid,cat.catname,pro.proid,pro.proname from 'order' as ord inner join 'customer' as cus on cus.custid=ord.custid inner join 'category' as cat on cat.catid=ord.catid inner join 'product' as pro on pro.proid=ord.proid #1064 - 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' as ord inner join 'customer' as cus on cus.custid=ord.custid inner join' at line 1
you cannot use 'order' as table name as it is a reserved word in mysql. But you can try using backticks ` to enclose it like these `order`, the backtick can be found on the top left hand side of your 101 keyboard. Do the same for the other tables.
-
you cannot use 'order' as table name as it is a reserved word in mysql. But you can try using backticks ` to enclose it like these `order`, the backtick can be found on the top left hand side of your 101 keyboard. Do the same for the other tables.
thank u so mch :)