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.
我有 5 列的表,其中之一是名为 product_id 的列,其中我存储 id 用逗号分隔,例如:
1,23,43
可以通过mysql查询来计算这些数字吗?我需要知道它才能对产品进行分页...
我需要知道有 3 个 ID(3 个产品)
最好的问候米。
尝试这个
select LENGTH(product_id) - LENGTH(REPLACE(product_id, ',', ''))+1 as counts from table1
在这里演示