I have these values(mentioned BELOW) which i’m trying to insert in (newly made) salary column of employees table. Salary column is INT NOT NULL DEFAULT 25000.
37000, 32000, 35000, 45000, 55000, 37000.
I have got these values for emp_id column which are already there
101, 102, 103, 104, 105, 106
I’ve tried these syntax
INSERT INTO employees(Salary)
VALUES (37000), (32000), (35000), (45000), (55000), (37000);
and
ALTER table employees INSERT INTO Salary VALUES (37000, 32000, 35000, 45000, 55000, 37000);
and many more but won’t embarrass myself more xD
[]
2
Answers
Use
UPDATE
to modify the contents of existing rows. UseCASE
to specify the value for each employee ID.Use UPDATE. Provide the id-salary values pairs as a datasource: