SQL - IF EXISTS UPDATE ELSE INSERT Syntax Error

前端 未结 6 651
花落未央
花落未央 2020-12-08 07:29

I have the following SQL query:

IF EXISTS(SELECT * FROM component_psar WHERE tbl_id = \'2\' AND row_nr = \'1\') 
   UPDATE component_psar
      SET col_1 = \         


        
6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-08 07:48

    Here is the link to documentation INSERT ... ON DUPLICATE Statement.

提交回复
热议问题