title: How to count a total in Postgresql and not have a range for each row?
body: <p>On our postgreSql Database we have two table one is appointment and the other one location. We are currently counting the number of Appointment per location.</p>
  
  <p>We use the following query. Unfortunately it is giving one row per every appointment whereas we would like to count the total. Is there a way to do this?</p>
  
  <p>Thank you!</p>
  
  <pre><code>select "domain".locations."name" AS  "Location Name",
         COUNT("domain".appointments."id") AS "Number Of Appointment",
         "domain".locations.mongo AS "Location ID Mongo",
         "domain".locations."id" AS "Location ID",
         "domain".countries."name" AS "Country Name",
         to_char("domain".appointments.created_at,'FMDD.MM.YYYY') AS "Appointment Created Date"
  from "domain".appointments
  INNER JOIN "domain".locations
      ON  "domain".locations."id" = "domain".appointments.location_id
  INNER JOIN "domain".countries
      ON "domain".locations.country_id = "domain".countries."id"
  WHERE "domain".appointments."source" = 'extranet'
    AND date_trunc('day', "domain".appointments.created_at) = date_trunc('day', current_date - 1)
    AND "domain".locations."id" &lt;&gt; '2016'
  GROUP BY "domain".locations."id",
           "domain".locations."name",
           "domain".countries."name",
           "domain".appointments.created_at,
           "domain".appointments."id"
  </code></pre>