select id, tenant_id, user_id, role, status, created_at from tenant_members where tenant_id = '816b24fe-a0c3-4409-b79b-c6c0a6935d03'::uuid order by (case when role = 'clinic_admin' then 0 else 1 end), created_at;