Oracle SQL - error when using GROUP BY -
select i.sicil_no, m.adi, m.soyadi, i.net_tutar, i.odeme_tarihi ibrmt050 i, mismt301 m (i.sicil_no=m.sicil_no , odeme_turu='36' , odeme_tarihi between '01/01/2012' , '30/06/2012') group to_char(i.odeme_tarihi,'mm') , to_char(i.odeme_tarihi,'yyyy') order to_char(i.odeme_tarihi,'yyyy') , to_char(i.odeme_tarihi,'mm');
i want list per month query gives error.
"not group expression"
what supposed ?
according documentation: http://docs.oracle.com/cd/b28359_01/server.111/b28286/statements_10002.htm
restrictions on select list
select list subject following restrictions:if specify group_by_clause in statement, select list can contain following types of expressions:
- constants
- aggregate functions , functions user, uid, , sysdate
- expressions identical in group_by_clause. if group_by_clause in subquery, group columns of the
subquery must match select list of outer query. columns
in select list of subquery not needed group
operation ignored without error.- expressions involving preceding expressions evaluate same value rows in group
the select statements of query contains following columns:
select i.sicil_no, m.adi, m.soyadi, i.net_tutar, i.odeme_tarihi
that not listed in group list, , source of error.
Comments
Post a Comment