Skip to main content

Basic Groups Queries

Start your journey into Groups data with these foundational queries. Each example builds your SQL skills while providing immediate value for your ministry.

Query Customization Required

These example queries demonstrate common patterns but may require adjustments to match your specific database schema and field names. Test thoroughly in your environment before use.

Query Requirements

Schema Prefix

IMPORTANT: All tables in the Planning Center Groups module live in the planning_center schema. Always prefix table names with planning_center. when querying. ✅ CORRECT: SELECT * FROM planning_center.groups_groups ❌ INCORRECT: SELECT * FROM groups_groups

Row Level Security (RLS)

Row Level Security automatically enforces:
  • tenant_organization_id – results scoped to your organization
  • system_status – only active records returned by default
Skip manual filters for these columns—RLS already applies them and extra predicates can suppress data or hurt performance:
  • WHERE tenant_organization_id = 1
  • WHERE system_status = 'active'
Keep your filters focused on ministry context (archived groups, roles, schedules) while RLS handles tenant isolation.

Table of Contents

Viewing Groups

List All Active Groups

Find Groups by Name

Groups by Size

Recently Created Groups

Finding Members

List All People in Groups

People with Leadership Permissions

Understanding Memberships

View All Memberships

Find Leaders vs Members

Recent Group Joins

Connect Members to Groups

Working with Events

List Upcoming Events

Find Canceled Events

Multi-Day Events

Events with Virtual Options

Tracking Attendance

View Recent Attendance Records

Attendance Rate Summary

Date-Based Queries

Groups Created This Year

Weekly Event Schedule

Monthly Membership Growth

Basic Aggregations

Group Statistics

Groups by Meeting Type

Membership Role Distribution

Event Frequency by Day

Groups Without Recent Events

Tips for Writing Queries

1. Check for Active Groups

2. Handle NULL Values Properly

3. Use Date Functions

4. Case-Insensitive Searches

5. Aggregate with Filters

Common Issues & Solutions

Issue: No results when joining tables

Solution: Make sure you’re using the correct join columns and that data exists in both tables.

Issue: Duplicate results

Solution: You might need to use DISTINCT or check your join conditions.

Issue: Date comparisons not working

Solution: Ensure you’re using the correct date/timestamp format and comparison operators.

Issue: Group counts don’t match

Solution: Check if you’re filtering for active groups (archived_at IS NULL).

Next Steps

Ready to connect data across tables? Continue with: