MySQL - Update and Delete Records (update, delete)

Опубликовано: 22 Ноябрь 2019
на канале: Eli the Computer Guy
3,486
119

Find code and diagrams at: https://www.EliTheComputerGuy.com

Updating and Deleting records in a table is very easy. Remember that MySQL does not ask for verification of a command, and so a poorly written statement can be devastating to a database.

update users set column1=‘x’ where column2=’a’; – Updates ALL records where condition is true
update users set column1=‘x’ where column2=’a’ and column3=‘b’; – Updates ALL records where two conditions are true
update users set column1=‘x’, column2=‘y’ where column3=’a’ ; – Updates two columns where condition is true
delete from table where column=‘x’; – Deletes ALL records where the conditions is true
delete from table where column1=‘x’ and column2=‘y’; – Deletes ALL records where two conditions are true


Смотрите видео MySQL - Update and Delete Records (update, delete) онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Eli the Computer Guy 22 Ноябрь 2019, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 3,486 раз и оно понравилось 119 людям.