Mysql insert command with where clause

im trying to insert data into a specific row in the database, but mysql says this is an error:

INSERT INTO user (rep, course) VALUES('5', 'computer science') WHERE user='2'
+3
source share
4 answers
UPDATE user 
   SET rep = '5', course = 'computer science' 
 WHERE user = '2'

Link to documents .

+4
source

Instead, you can UPDATE ,

UPDATE user set rep='5', course='computer science' WHERE user='2'
+2
source

INSERT WHERE.

+1

INSERT WHERE, INSERT, - , ?

, WHERE INSERT....

: UPDATE table-name SET column=val WHERE some cont

Command if you need to update an existing row ....

0
source

Source: https://habr.com/ru/post/1769833/


All Articles