All pastes #2107616 Raw Edit

Unnamed

public sql v1 · immutable
#2107616 ·published 2012-01-30 01:02 UTC
rendered paste body
select sum (KreditneUroky - DebetneUroky) AS CistyUrok, sum(PocetTransakcii)from faktleft join dimMesiac using(MesiacKey)left join dimDomacnost using(DomacnostKey)left join dimProdukt using(ProduktKey)where DomacnostMaDeti = "Nie" and Rok >= 2005 and Rok <= 2010group by ProduktSkupina, MesiacRokselect count(*) as PocetUctov, sum(Zostatok)from faktleft join dimMesiac using(MesiacKey)left join dimStavUctu using(StavUctuKey)where ZmenaZostatku < 0 and MesiacRok = "December 2011" and KreditneUroky > DebetneUroky + 1 and StavUctu = "otvoreny"select PobockaMestofrom faktleft join dimPobocka using(PobockaKey)left join dimStavUctu using(StavUctuKey)where StavUctu = "novy" and KvartalRok in ("Q3 2010", "Q4 2010", "Q1 2011") and PobockaKraj = "Bratislavsky kraj"