Subject | error with query |
---|---|
Author | luiz Rafael |
Post date | 2006-04-28T01:45:31Z |
Dear Friends
the query bellow is returning error for me, telling that the number of
columns dont match.
as Far I know, only the colunms not specified on sum, should be on group by
query bellow
CREATE VIEW rafaelzM (xcliente, xqtdr, xbruto, xliquido, xper, impureza,
umidade, ardido, danificado, colh, tran) AS SELECT
gmitef."CLIENTE" AS "XCLIENTE",
SUM(gmitef."QTDR") AS "XQTDR",
SUM(gmitef."QUANTIDADE") AS "XBRUTO",
gmitef."QTDR" AS "XLIQUIDO",
ABS( (abs(gmitef."QUANTIDADE" - gmitef."QTDR") * 100) /
gmitef."QUANTIDADE") AS "XPER",
gmitef."QTDP1" AS "IMPUREZA",
gmitef."QTDP2" AS "UMIDADE",
gmitef."QTDP3" AS "ARDIDO",
gmitef."QTDP4" AS "DANIFICADO",
gmpedf."COLHEDEIR" AS "COLH",
gmpedf."TRANSPORT" AS "TRAN"
FROM
"GMITEF" gmitef ,
"GMPEDF" gmpedf WHERE gmitef."NOTA_FISCA" = gmpedf."NOTA_FISCA" AND
gmitef."TIPO_DOCTO" = gmpedf."TIPO_DOCTO" AND gmitef."FORNECEDOR" =
gmpedf."FORNECEDOR" AND gmitef."QTDR" > 0 AND gmitef."MANUTENCAO" >=
'2006/01/01' AND gmitef."MANUTENCAO" <= '2006/12/31' AND gmitef."SR_DELETED"
= ' ' AND gmpedf."SR_DELETED" = ' '
GROUP BY
gmitef."CLIENTE",
gmitef."QTDR",
gmitef."QUANTIDADE",
gmitef."QTDP1",
gmitef."QTDP2",
gmitef."QTDP3",
gmitef."QTDP4",
gmpedf."COLHEDEIR",
gmpedf."TRANSPORT"
Regards
Luiz
the query bellow is returning error for me, telling that the number of
columns dont match.
as Far I know, only the colunms not specified on sum, should be on group by
query bellow
CREATE VIEW rafaelzM (xcliente, xqtdr, xbruto, xliquido, xper, impureza,
umidade, ardido, danificado, colh, tran) AS SELECT
gmitef."CLIENTE" AS "XCLIENTE",
SUM(gmitef."QTDR") AS "XQTDR",
SUM(gmitef."QUANTIDADE") AS "XBRUTO",
gmitef."QTDR" AS "XLIQUIDO",
ABS( (abs(gmitef."QUANTIDADE" - gmitef."QTDR") * 100) /
gmitef."QUANTIDADE") AS "XPER",
gmitef."QTDP1" AS "IMPUREZA",
gmitef."QTDP2" AS "UMIDADE",
gmitef."QTDP3" AS "ARDIDO",
gmitef."QTDP4" AS "DANIFICADO",
gmpedf."COLHEDEIR" AS "COLH",
gmpedf."TRANSPORT" AS "TRAN"
FROM
"GMITEF" gmitef ,
"GMPEDF" gmpedf WHERE gmitef."NOTA_FISCA" = gmpedf."NOTA_FISCA" AND
gmitef."TIPO_DOCTO" = gmpedf."TIPO_DOCTO" AND gmitef."FORNECEDOR" =
gmpedf."FORNECEDOR" AND gmitef."QTDR" > 0 AND gmitef."MANUTENCAO" >=
'2006/01/01' AND gmitef."MANUTENCAO" <= '2006/12/31' AND gmitef."SR_DELETED"
= ' ' AND gmpedf."SR_DELETED" = ' '
GROUP BY
gmitef."CLIENTE",
gmitef."QTDR",
gmitef."QUANTIDADE",
gmitef."QTDP1",
gmitef."QTDP2",
gmitef."QTDP3",
gmitef."QTDP4",
gmpedf."COLHEDEIR",
gmpedf."TRANSPORT"
Regards
Luiz