Editing
Mental health expansion
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== group sessions ==== <syntaxhighlight lang="postgresql" line> WITH params AS ( -- Set the first day of the reporting month here SELECT DATE '2025-06-01' AS rpt_start ), session_attendance AS ( SELECT ga."Id" AS group_id, ga."Date" AS session_date, COUNT(DISTINCT gcp."ClientParticipantId") AS attendees FROM kotahi.groupactivities ga JOIN kotahi.groupactivityclientparticipant gcp ON ga."Id" = gcp."GroupActivityId" CROSS JOIN params p WHERE ga."ServiceId" = 6 AND ga."Date" >= p.rpt_start AND ga."Date" < (p.rpt_start + INTERVAL '1 month') AND gcp."Attendance" = 1 GROUP BY ga."Id", ga."Date" ) SELECT CASE WHEN attendees BETWEEN 2 AND 14 THEN '02β14' WHEN attendees >= 15 THEN '15+' ELSE 'Fewer than 2 (ignored)' END AS session_size_band, COUNT(*) AS session_count FROM session_attendance WHERE attendees >= 2 -- exclude 1-person sessions which I doubt will ever happen GROUP BY session_size_band ORDER BY session_size_band; </syntaxhighlight>
Summary:
Please note that all contributions to Kautepedia are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Kautepedia:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
British English
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
British English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information