Skip to content
Advertisement

SQL query to get number of clients with last statement equal connected


I need to make a SQL query

table ‘records’ structure:

It has to show the following:

Could somebody help?

sample data:

desired output:

I tried something with sub queries, but it obviously doesn’t work:

How should I use the inner selects?
I must write a poem, because most of my post is a code. So maybe something from “Dead man”?

“Don’t let the sun burn a hole in your ass, William Blake. Rise now, and drive your cart and plough over the bones of the dead!”

😉

Advertisement

Answer

Try something like this:

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