Comments - Getting pct from SUM data

3 years, 8 months ago Ian Gilfillan

You cannot use the alias there, as it hasn't been evaluated yet. Something like:

SELECT 
  SUM(NumCalls) as SUM_NumCalls, 
  SUM(NumCompleted) as SUM_NumCompleted, 
  (SUM(NumCompleted) * 100 / SUM(NumCalls)) as  ...

should work.

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.