Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个表,其中包含一行数据,例如'/2323/3235/4545/222/'如何仅使用 mysql 计算每行中 / 的数量。
'/2323/3235/4545/222/'
快速搜索得出了这个:
SELECT LENGTH('/2323/3235/4545/222/') - LENGTH(REPLACE('/2323/3235/4545/222/','/','')) ... etc;
关联
SELECT LENGTH('/2323/3235/4545/222/') - LENGTH(REPLACE('/2323/3235/4545/222/', '/', '')) AS `occurrences`