sql - Reference field in MySQL SET Query -
so have table looks likes this
+----+----------------------+--------------------------+----------+----------+ | id | fullname | email | username | password | +----+----------------------+--------------------------+----------+----------+ | 1 | john doe | johndoe@example.com | johndoe | password | | 2 | jane doe | janedoe@example.com | janedoe | password | +----+----------------------+--------------------------+----------+----------+
what want change "password" "1". example, table after query:
+----+----------------------+--------------------------+----------+----------+ | id | fullname | email | username | password | +----+----------------------+--------------------------+----------+----------+ | 1 | john doe | johndoe@example.com | johndoe | johndoe1 | | 2 | jane doe | janedoe@example.com | janedoe | janedoe1 | +----+----------------------+--------------------------+----------+----------+
i tried doing update table set password=username+"1" id=1;
didn't work. no surprise there.
how this?
Comments
Post a Comment