Uploaded image for project: 'PresideCMS'
  1. PRESIDECMS-647

Preside objects data select: just get a record count

    Details

    • Type: Improvement
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects versions: None
    • Fix versions: 10.8.0
    • Labels:
      None
    • Sprint:
    • Accepted:
      Yes

      Description

      This is actually more involved than just replacing the selectFields with "count(1) as record_count". Once you have HAVING filters, etc ( PRESIDECMS-646 Done ). you will need a subquery, so:

      select count(1) as record_count 
      from (
      	select     website_user.id
      	from      `psys_website_user` `website_user`
      	left join `psys_website_benefit__join__website_user` `benefits` on (`benefits`.`website_user` = `website_user`.`id`) 
      	group by   website_user.id
      	having     Count( `benefits`.`website_user` ) = 0
      ) subquery;
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              admin Dominic Watson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: