Home > database >  Mysql data with the same type of average fill the missing value
Mysql data with the same type of average fill the missing value

Time:10-10

Table has more restaurants per capita consumption of consumption, the restaurant is divided into several types
Consumption, some restaurant need to use the restaurant belongs to type of consumption of average to fill the missing value
Just began to learn the mysql, and instruct me how to write this to you thank you thank you!!!

CodePudding user response:

 
The UPDATE test0706 set VALUE=https://bbs.csdn.net/topics/(SELECT * from (SELECT ROUND (avg (` VALUE `), 0) from ` test0706 `) a) where ` VALUE `='0'

CodePudding user response:

reference 1st floor Gunlance response:
 
UPDATE test0706 set VALUE=https://bbs.csdn.net/topics/(SELECT * from (SELECT ROUND (avg (` VALUE `), 0) from ` test0706 `) a) where ` VALUE `='0'
valuehttps://bbs.csdn.net/topics/='https://bbs.csdn.net/topics/0' you can be written as the VALUE is null or valuehttps://bbs.csdn.net/topics/=', what is the missing VALUE specific look at your list
  • Related