UPDATE table name SET column name=value WHERE id=n;
I learned and understood this,
] (6f4df9c26ab2fa7d7bcaca6c90f577a1.png)
UPDATE Don't do it one by one,
I was wondering if I could sort out the producer names all at once.
Is this the correct answer?
I tried it, but I got a syntax error
I think it's probably a very basic thing, but thank you. When I wrote it while googled, it was solved now so w
Please tell me the correct answer from your teacher.
AddendumWith this feeling, the value of the manufacturer is NULL,
When assigning each name by UPDATE at once
UPDATE my_items SET
maker = case id WHEN '2' THEN'Yamauchi' WHEN '3' THEN'Otsuka' WHEN '4' THEN'SHIMADA' WHEN '5' THEN'Journouchi' WHEN '6' THEN'Abe' END WHERE id between 2 and 6;
It was made.
-
Answer # 1
-
Answer # 2
If such a branch occurs, table that information and update via that table.
<maker_list>
ID MAKER 2 Yamauchi 3 Otsuka Four Shimada Five Loach 6 Abe UPDATE my_items item inner join maker_list list on item.ID=list.ID SET item.maker=list.maker
-
Answer # 3
UPDATE my_items SET
maker = caseid
WHEN '2' THEN'Yamauchi' WHEN '3' THEN'Otsuka' WHEN '4' THEN'Shimada' WHEN '5' THEN'Shounouchi' WHEN '6' THEN'Abe' END WHEREid
between 2 and 6;
Related articles
- about creating multiple records for access queries
- mysql - how to retrieve records for which multiple columns have not been entered and prevent duplication
- mysql - i want to update using multiple tables with update
- php - about the multiple structure of laravel's many-to-many relations
- python - i have a question about multiple updates of pymongo
- php - about mysql
- mysql - about nodejs inner join
- mysql - about database design
- mysql - how to update to rails6
- mysql - about data extraction method
- vba - about multiple condition search of the same field using access form check box
- about building mysql ndb cluster
- mysql - about the database
- about errors when connecting to mysql (codeigniter, xdebug, mysql)
- php - please tell me about freeing mysql memory
- vba - i want to get multiple records in a csv file, but i can only get one record (a pair of headers and values)
- mysql - about docker error
- php - i want to update multiple tables efficiently with short code with updateall
- mysql - about the setting to connect to the db in docker from the sql client
- php - about "update" when adding products in the shop to the cart while creating an ec site
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- python - you may need to restart the kernel to use updated packages error
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- python 3x - typeerror: 'method' object is not subscriptable
- javascript - how to check if an element exists in puppeteer
- xcode - pod install [!] no `podfile 'found in the project directory
- i want to call a child component method from a parent in vuejs
- vuejs - [vuetify] unable to locate target [data-app] i want to unit test to avoid warning
If you only need to enter the same manufacturer name, specify where normally