MapInfo Pro

 View Only
  • 1.  SQL: Calculate count of object within each subdistrict based on object's category

    Posted 11-02-2023 03:15

    Hi All.

    I want to calculate the count of Point of Interest within subdistricts based on PoI's category.

    There are 17 subdistricts contains PoI. 

    However, when I group by PoI's category, the result shows only 7 subdistricts. Another 10 is not counted.

    Is there any issues with my SQL? Thank you.



    ------------------------------
    Wahida Latif
    Map Information Solutions Sdn Bhd
    KUALA LUMPUR
    ------------------------------


  • 2.  RE: SQL: Calculate count of object within each subdistrict based on object's category

    Posted 11-02-2023 03:47

    Hi Wahida,

    Try listing the names of the columns you are grouping on in the "Group By Columns" text box, separated by commas.  In your first query, that would be:

    Population_by_MUKIM.MUKIM

    and in your second:

    Population_by_MUKIM.MUKIM, POI.DESCRIPTION



    ------------------------------
    James Nolet
    GIS Manager
    Caf Consulting
    Mentone office, VIC, Australia
    ------------------------------



  • 3.  RE: SQL: Calculate count of object within each subdistrict based on object's category

    Posted 11-30-2023 04:39

    Hi James, thank you. I got it !



    ------------------------------
    Wahida Latif
    Map Information Solutions Sdn Bhd
    KUALA LUMPUR
    ------------------------------