| simple sql left join problem
|
snehula

msg:4325506 | 3:29 pm on Jun 13, 2011 (gmt 0) | Can anybody see why I'm getting the error: | #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 LEFT JOIN product ON order.idProduct = product.idProduct WHERE order.idCus' at line 1 |
| with the following query: SELECT product.product_name, product.product_type, order.order_status, order.order_date, order.order_desc FROM order LEFT JOIN product ON order.idProduct = product.idProduct WHERE order.idCustomer = 21 ORDER BY order.order_date |
| when all the field names and table names are right?
|
coopster

msg:4325535 | 4:41 pm on Jun 13, 2011 (gmt 0) | "order" is a reserved word in MySQL. [dev.mysql.com...]
|
rocknbil

msg:4325548 | 4:57 pm on Jun 13, 2011 (gmt 0) | Right, backtick `` (not quote) table and field names.
|
snehula

msg:4325650 | 8:43 pm on Jun 13, 2011 (gmt 0) | thanx a mil :-)
|
|
|