Last answered:

01 Apr 2020

Posted on:

31 Mar 2020

0

SQL error codes

select m.dept_no,m.emp_no,d.dept_name
from table dept_manager_dup m
inner join dept_dup d on m.dept_no=d.dept_no
I am running this code at the very beginning of a query file and after hovering my cursor it shows SELECT is not valid at this position 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 'table dept_manager_dup m inner join dept_dup d on m.dept_no=d.dept_no' at line 2  
 
 
1 answers ( 0 marked as helpful)
Instructor
Posted on:

01 Apr 2020

0
Hi Neelanjan! Thanks for reaching out. The syntax doesn't require us to write FROM TABLE, but just FROM. In other words, your FROM clause hasn't been written correctly. Here's the correct version of your query.
SELECT 
    m.dept_no, m.emp_no, d.dept_name
FROM
    dept_manager_dup m
        INNER JOIN
    dept_dup d ON m.dept_no = d.dept_no;
Hope this helps.
Best,
Martin

Submit an answer