Home > database >  How to calculate the column in MYsql divided by the sum of the column
How to calculate the column in MYsql divided by the sum of the column

Time:09-29



O baidu30data/sum (baidu30data)

CodePudding user response:

MY SQL does not support partition by range
You can use the following
 
Select *, a. aidu30data/b.a from a TB as a
INNER join (select sum (baidu30data) as aa from TB) b on 1=1;

CodePudding user response:

The subquery.

CodePudding user response:

1/f, positive solution! Thank smecta.

CodePudding user response:

The select clause also can directly use the subquery,

CodePudding user response:

Select *, a. aidu30data/(select sum (baidu30data) from TB) a.a from TB as a a
  • Related