1
0
Code Issues Pull Requests Projects Releases Wiki Activity GitHub Gitee
answerbook/sql/analysis.sql

12 lines
267 B
MySQL
Raw Normal View History

2022-09-24 20:55:17 +08:00
SELECT
total_count,
distinct_count,
total_count - distinct_count AS repeat_count
FROM
(
SELECT
count(text) AS total_count,
count(DISTINCT text) AS distinct_count
FROM
`answer`
) as tab