Skip to content
Advertisement

Count child members from parent value

I have a table like conversations and conversation_timelines

conversations table example

conversation_timelines table example

What I want to query is Counting the number of records in conversation_timelines that has created_time > conversation's last_active WHERE conversations.category_id = 1

and the result world be like

Advertisement

Answer

You can use the following solution, using a JOIN with GROUP BY:

demo on dbfiddle.uk

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement