sql >> Databasteknik >  >> RDS >> PostgreSQL

summa och generera serier fungerar inte i postgresql

select
    data.d::date,
    coalesce(sum(classification_indicator_id), 0)::integer as "Segment1"
from 
    classifications c
    right join
    generate_series(
        '2013-03-25'::timestamp without time zone,
        '2013-04-01'::timestamp without time zone,
        '1 day'::interval
    ) data(d) on data.d::date = c.data_start::date
where classification_indicator_id = 3
group by 1
ORDER BY 1


  1. XML-server XML-prestandaoptimering

  2. RSA i Android producerar rätt nycklar men fel dekryptering

  3. Importera text till MySQL:konstigt format

  4. hur man infogar flera rader i sqlite android