SELECT SUM(LENGTH(room_id) – LENGTH(REPLACE(room_id, ‘,’, ”)) + 1) as total FROM booking
I have applied this MySQL query, it working fine but it counts duplicate values. How I can remove duplicate values while count from the comma-separated fields in MySQL.
My Column Like
id room_id
1 2, 4, 5
2 4, 3
I want to show the count result total = 4
Now it counts 5
Question and answer is powered by AnsPress.io