select - SQL complicated query -


i have following problem sql query. managed execute 15 of them 1 makes me sick. it's hard translate understand.

show years , months numbers , sum of costs of ‘borrowed-time’ in months monthly sum of costs lesser biggest 1 in february , march in 2006.

and have far (one of version of query because tried many of them)

select extract(month data_wyp), sum(koszt)  wypozyczenia  koszt<(select sum(koszt)                wypozyczenia               sum(koszt)<(select max(sum(koszt))                                 wypozyczenia                                 extract(month data_wyp)='2' or                                 extract(month data_wyp)='3'                                 group extract(month data_wyp))) group extract(month data_wyp); 

the problem cannot equal sum(koszt), tried save them using as doesn't work either.

please me because ruined day.

thanks in advance.

to filter results of aggregate function in sql query, place comparisons in having statement.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -