sql >> Database teknologi >  >> RDS >> Mysql

Valg/casting af output som heltal i SQL

SELECT 
  CAST(sum(number)/count(number) as UNSIGNED) as average, 
  date 
FROM stats 
WHERE * 
GROUP BY date


  1. MariaDB JSON_LOOSE() Forklaret

  2. Hvordan reparerer jeg en InnoDB-tabel?

  3. Hvordan afrundes en DateTime i MySQL?

  4. For at ignorere dublerede nøgler under 'copy from' i postgresql