本文介绍了计数次数值出现在MySQL的列中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试着寻找这里的无处不在,但我的搜索没有给我任何答案。
查看悉尼一词在郊区列中出现的次数

Tried looking everywhere for this but my searching hasn't given me any answers.Looking to count how many times the word 'Sydney' comes up in the column 'Suburb'

CustomerId  FirstName   LastName    StreetAddress   Suburb  PostCode
C001    James           Smith       400 Kent St     Sydney      2000
C002    Maria           Carpenter   333 Smith St    Westmead    2145
C003    Dennis          Miller      214 Uni Rd      Sydney      2000

我想要它提供一个结果:

I want it to provide an outcome like:

numCustomersFromSydney
                    2


推荐答案

select count(*) as numCustomersFromSydney from table where Suburb = "Sydney";

这篇关于计数次数值出现在MySQL的列中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 18:24