Group by problems
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.