Sie müssen nur CROSS JOIN
machen die SUM()
von Number
Spalte:
SELECT Name, Number, Number * 100 / t.s AS `% of total`
FROM mytable
CROSS JOIN (SELECT SUM(Number) AS s FROM mytable) t
Sie müssen nur CROSS JOIN
machen die SUM()
von Number
Spalte:
SELECT Name, Number, Number * 100 / t.s AS `% of total`
FROM mytable
CROSS JOIN (SELECT SUM(Number) AS s FROM mytable) t