What happens if you add "and" without "where" in an update statement?

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: updae 加了and没有where会怎么样

| username: Running

The image you uploaded is not visible. Please provide the text you need translated.

| username: tidb菜鸟一只 | Original post link

The entire table will be updated, right?

| username: 啦啦啦啦啦 | Original post link

The entire table’s orkd_intoyear will be updated to 2023, use with caution.

| username: 大飞哥online | Original post link

Full table update

| username: Kongdom | Original post link

and indicates updating multiple fields without filtering data.
where indicates filtering data based on conditions; without where, all data will be updated.

| username: Fly-bird | Original post link

All data

| username: kkpeter | Original post link

If it can’t be restored when executed online, I suggest you pack up and leave.

| username: 像风一样的男子 | Original post link

Executing this way will end very badly.

| username: zhanggame1 | Original post link

You can test it.

| username: 大飞哥online | Original post link

Before testing, get the bucket ready, hahaha.

| username: 昵称想不起来了 | Original post link

Terrifying, a full table update (time to run away).

| username: Soysauce520 | Original post link

Quick rollback.

| username: ti-tiger | Original post link

MySQL is fine, nothing will be updated.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.