MYSQL calculating an average on a count

后端 未结 2 843
南笙
南笙 2021-01-28 14:16

I have a simple query that I want an average on. This is what it looks like now, and I want to know the average of my count per Opname_OpnameID.

SELECT Opname_O         


        
2条回答
  •  滥情空心
    2021-01-28 14:46

    You can use count(distinct) and not use a subquery:

    SELECT count(*) / count(distinct Opname_OpnameID)
    FROM behandeling
    

提交回复
热议问题