MySQL Forums
Forum List  »  Newbie

Table column with keyword as name
Posted by: Rigoletto Eikenberg
Date: July 18, 2018 12:48AM

Hello,

we have a 3th party software running and want to update data in a table.
But this fails cause one columen is named "primary".

insert into entity_phone_number (entity_id,phone_number_id,entity_type,primary) values
(102097,10209704642915510,'Account',1),(102098,1020980407459130,'Account',1)
on duplicate key update entity_id=values(entity_id),phone_number_id=values(phone_number_id),entity_type=values(entity_type),primary=values(primary)

gives

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'primary) values
(102097,10209704642915510,'Account',1),(102098,1020980407459130' at line 1

I cant change the column name, how can i slove this?

Server version: 5.7.22 - MySQL Community Server (GPL)

Sincerly

Options: ReplyQuote


Subject
Written By
Posted
Table column with keyword as name
July 18, 2018 12:48AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.