The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

SQL error codes

SQL error codes

0
Votes
1
Answer

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 Answer

365 Team
0
Votes

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

×
LAST CHANCE
Ready to Learn Data Science?
50% OFF