Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi everyone
i want to use join query
SQL
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 innerjoin 'category' as cat on cat.catid=ord.catid innerjoin 'product' as pro on pro.proid=ord.orderid

i don't know what's wrong with it
kindly help me out
its urgent

[edit]Code block added, spelling[/edit]
Posted
Updated 2-Mar-14 5:12am
v3
Comments
Nelek 2-Mar-14 11:12am    
Get used to write proper english please. Chat-SMS-Text makes your message looks not serious, on the other hand... not all people are english speakers and may not understand what you say

1 solution

innerjoin 

shoud be
inner join

and
pro.proid = ord.orderid

shoud it be ???
pro.proid = ord.proid

In addition, 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.
 
Share this answer
 
v4
Comments
zunisheikh 2-Mar-14 10:51am    
u r write dear
i edit these mistakes bt still it didnt work
#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
zunisheikh 2-Mar-14 10:52am    
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
now itz like this
Peter Leow 2-Mar-14 11:25am    
Right, the error msg has reminded us that 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. Good luck. It is pass midnight, I got to turn in now.
Peter Leow 2-Mar-14 19:21pm    
Do remember to accept solution and vote.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900