Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Importing information of just one column from another table

i wanna fill out a column named employee_id from another table by using select below is my query

INSERT INTO information (employee_id)
VALUES (SELECT employee_id FROM employee)

with the above query I am getting an error :

MySQL said: Documentation

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

#1064 – You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use
near ‘SELECT employee_id FROM employee)’ at line 3**

>Solution :

try like this:

INSERT INTO information (employee_id)
SELECT employee_id FROM employee;
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading