sql >> Databáze >  >> RDS >> PostgreSQL

součet a generovat série nefunguje v 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. MySQL fulltextové vyhledávání slov se třemi nebo méně písmeny

  2. MySql kombinuje LIMIT a ORDER BY

  3. aktualizace tabulky cizím klíčem

  4. MySQL longtext analog v Microsoft SQL?