I need to insert one value into a table based on an auto incremented ID, for example the ID = 7 and I want to insert “this” into a column based on the ID “7”.
I basically want to do this, but am not sure how to do it without auto incrementing the ID.
INSERT INTO table (tableData) VALUES (12345)
FROM table
WHERE ID = 7
I tried this:
INSERT INTO table (tableData)
SELECT ID FROM table
WHERE ID 7
But that just inserts the number 7 into the column and auto increments the table. Is there a way to insert a value based on the ID without auto-incrementing another row?
Thanks in advance
(SOLVED)
I figured out the problem. All I need to do was use UPDATE instead of INSERT so I used
UPDATE tablename
SET columnname ="something"
WHERE ID = "7"
I figured out the problem. All I need to do was use UPDATE instead of INSERT so I used