列如字段值'AABBCCA',我想算出字段里有几个A
PLSQL select应该怎么写?有现成的函数吗?
------解决方案--------------------
length('AABBCCA')-length(replace('AABBCCA','A',''))
------解决方案--------------------
- SQL code
SELECT LENGTH ('AABBCCA') - LENGTH (REPLACE ('AABBCCA', 'A', '')) FROM DUAL