通过以下方式显示带out的行数或计数。。count(name(,如果有多少name,则以count显示结果。。
x-Count数组中的所有元素或对象中的某些元素x-Count数组中的所有元素,或对象中的某些元素
id | name | count
1 | iya | 2
2 | iya | 2
3 | anna | 1
4 | jess | 2
5 | jess | 2
SELECT id, name, COUNT(name) OVER (PARTITION BY name) `count`
FROM sourcetable
或
SELECT t.id, t.name, ( SELECT COUNT(s.name)
FROM sourcetable s
WHERE s.name = t.name ) `count`
FROM sourcetable t