i need to rename document called patients which has attibutes called LAST to LAST_NAME
AS IT IS RESERVED WORD IT GIVE ME ERROR
UPDATE patients
SET LAST = LAST_NAME
UNSET LAST
;
HOW CAN I DO THAT
THANKS
i need to rename document called patients which has attibutes called LAST to LAST_NAME
AS IT IS RESERVED WORD IT GIVE ME ERROR
UPDATE patients
SET LAST = LAST_NAME
UNSET LAST
;
HOW CAN I DO THAT
THANKS
You don’t need to rename. Use back ticks when needed.
example:
SELECT `last`
FROM patients WHERE `last` = "abc";
UPDATE patients AS p
SET p.last_name = p.`last`
UNSET p.`last`;