SQLite Forum

How to convert to CTE
Login
Is this a sample of the data in your table or a sample of the output you want?

If it is the output you want, that is impossible to do in any SQL. The first two lines are exact duplicates of each other, which means the grouping identifier does not exist in the output. Impossible to do, or at least impossible to deduce the question (query) that caused this output.

If it is the actual data, then it at least isn't impossible, but it is much worse. Should those first two lines be added together? I mean they are both "Registered" and both have an ID of 1, and also both have 21020 Registrations, which feels wrong to me.

You should not assume that we know anything much about SQL, let alone your specific data or use case. Please explain it really good cause we are a simple people.

Show some of the data from the actual data base, then some sample of what your output should look like, and please make sure it is correct, else it is like asking us to build your jigsaw puzzle of a parrot by showing us a guide-image of a monkey.

Also, there is a nice feature in Markdown where you add tabular text like that output from the last post, inside block quotes using, for example, three backticks, like this:    
\`\`\`   
  then all your text you want to display, and again three backticks    
\`\`\`   
at the end. That will format it like blocked text (verbatim monospace).