Question and answer is powered by AnsPress.io
My database table column Like
id room_ids
1 2, 4, 5
2 4, 3
I want to show the result total = 5
I have tried with this query:
SELECT SUM(room_id) as total FROM booking
Did not work.
I have got the success to apply this query
SELECT SUM(LENGTH(room_id) - LENGTH(REPLACE(room_id, ',', '')) + 1) as total FROM booking