MySQL Forums
Forum List  »  Informix

Group by problems
Posted by: Adrian Baceanu
Date: December 13, 2005 04:38AM

In INFORMIX, an early version, I have a table created as follows:
create table "test".salvari
codc char(5),
codfisc char(20),
nrprezi integer,
nrprezf integer,
buc integer,
taxa float,
fel char(1),
numeex char(50),
adrex char(50),
locex char(30),
judex char(2),
data date,
timp datetime year to second,
nrord serial not null constraint "test".n308_129,
regl char(1)
revoke all on "test".salvari from "public";

create index "test".i_salvari1 on "test".salvari (codfisc,data);

create index "test".i_salvari2 on "test".salvari (data,codc);
create index "test".i_salvari3 on "test".salvari (codc);
create index "test".i_salvari4 on "test".salvari (codfisc);
create index "test".i_salvari5 on "test".salvari (nrprezi,nrprezf);

create index "test".salvari_data on "test".salvari (data);
create index "test".tr1 on "test".salvari (nrord);

and I have the following select statement: select * from salvari where data="11/06/2005" group by codfisc

Why is informix saying that codc needs to be in the group by statement, then, if I insert this column I get that nrprezi must be also in group by and so on. I just need a grouping by codfisc, because I need just one sum(taxa) for every distinct codfisc. Please help, 'cause I'm novice.

Edited 1 time(s). Last edit at 12/13/2005 04:51AM by Adrian Baceanu.

Options: ReplyQuote

Written By
Group by problems
December 13, 2005 04:38AM
December 15, 2008 10:33PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.