# MySQL error. Error Code: 1064

**URL:** <https://forum.codewithmosh.com/t/mysql-error-error-code-1064/1855>\
**Category:** SQL\
**Created:** [January 11, 2021, 11:54pm UTC](https://forum.codewithmosh.com/t/mysql-error-error-code-1064/1855 "2021-01-11T23:54:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![slimally22](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@slimally22](https://forum.codewithmosh.com/u/slimally22)\
**Post date:** [January 11, 2021, 11:54pm UTC](https://forum.codewithmosh.com/t/mysql-error-error-code-1064/1855/1 "2021-01-11T23:54:31Z")

</div>

Hello,

Am learning the Inner and Outer Joins and I have experienced this error below on 2 occasions while running the query below.

SELECT  
c.customer\_id,  
c.first\_name,  
o.order\_id,  
FROM customers c  
JOIN orders o  
ON c.customer\_id = o.customer\_id  
ORDER BY c.customer\_id

**I got Error Code: 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 ‘FROM customers c JOIN orders o ON c.customer\_id = o.customer\_id ORDER BY c.custo’ at line 5**

How Do I solve this.

Thanks in Advance

---

<div class="post-metadata">

**Author:** ![SAM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sam/32/167_2.png) [@SAM](https://forum.codewithmosh.com/u/SAM)\
**Post date:** [January 12, 2021, 5:47am UTC](https://forum.codewithmosh.com/t/mysql-error-error-code-1064/1855/2 "2021-01-12T05:47:46Z")

</div>

> [@slimally22](#):
>
> ```sql
> o.order_id,
> FROM customers c
> 
> ```

The comma after order\_id is the problem. MySQL is expecting another column definition after the comma.

---

<div class="post-metadata">

**Author:** ![slimally22](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@slimally22](https://forum.codewithmosh.com/u/slimally22)\
**Post date:** [January 12, 2021, 3:21pm UTC](https://forum.codewithmosh.com/t/mysql-error-error-code-1064/1855/3 "2021-01-12T15:21:57Z")

</div>

Thanks Sam, It worked.
