069.match_subquery.mql 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. MATCH (person:/univ_demo/person WHERE status = '在职' AND (polity = '中共党员' OR polity = '中共预备党员'))
  2. -[:person_to_org*1..1]->
  3. (org:/univ_demo/org)
  4. RETURN person.account AS "person_account", org.name AS "org_name" INTO /temp01_party_member_eb1a5b20-4177-4eed-89c8-77c800d6fc8b-0 WITH TIMEOUT = 5m
  5. /**
  6. output()
  7. **/
  8. ;
  9. {"sql":"SELECT temp01.org_name AS \"学院名称\", count(temp01.person_account) AS \"党员人数\" FROM /temp01_party_member_eb1a5b20-4177-4eed-89c8-77c800d6fc8b-0 temp01 GROUP BY temp01.\"org_name\" ORDER BY \"党员人数\" DESC LIMIT 0, 500000"}
  10. /**
  11. output()
  12. count(82)
  13. **/
  14. ;
  15. SELECT temp01.org_name AS "学院名称", count(temp01.person_account) AS "党员人数" FROM
  16. (MATCH (person:/univ_demo/person WHERE status = '在职' AND (polity = '中共党员' OR polity = '中共预备党员'))
  17. -[:person_to_org*1..1]->(org:/univ_demo/org)
  18. RETURN person.account AS "person_account", org.name AS "org_name") temp01
  19. GROUP BY temp01."org_name" ORDER BY "党员人数" DESC LIMIT 0, 500000 WITH TIMEOUT = 5m
  20. /**
  21. output()
  22. count(82)
  23. **/
  24. ;