ошибка при выполнении запроса вида ..
"Insp" VARCHAR(4)
CHARACTER SET WIN1251 DEFAULT '' COLLATE PXW_CYRL
"Acc_num" VARCHAR(7)
CHARACTER SET WIN1251 DEFAULT '' COLLATE PXW_CYRL
"Dat" DATE
"D" DECIMAL(18,2)
"C" DECIMAL(18,2)
"IDpck" INTEGER
"IDkzn" INTEGER
-- пример запроса --
SELECT "Insp", "Acc_num", "Dat", "D", "C", "IDpck", "IDkzn" ');
FROM "Kzn"
WHERE
"Insp" in ('0001','0002') and
"Acc_num" in ('1010510','1400310','030120') and
"Dat" between '12-MAR-2003' and '23-APR-2003'
UNION
SELECT "Insp", "Acc_num", max("Dat") dat, sum("D") D, sum("C") C, 0 IDpck, 0 IDkzn
FROM "Kzn"
WHERE
"Insp" in ('0001','0002') and
"Acc_num" in ('1010510','1400310','030120') and
"Dat" between '12-MAR-2003' and '23-APR-2003'
GROUP BY "Insp", "Acc_num"
order by "Insp","Acc_num" // на этой строке ошибка след (invalid ORDER BY clause)
заранее благодарен за Ваше внимание :о)
Цитата:
Originally posted by Allexe
-- поля таблицы Kzn --
"Insp" VARCHAR(4)
CHARACTER SET WIN1251 DEFAULT '' COLLATE PXW_CYRL
"Acc_num" VARCHAR(7)
CHARACTER SET WIN1251 DEFAULT '' COLLATE PXW_CYRL
"Dat" DATE
"D" DECIMAL(18,2)
"C" DECIMAL(18,2)
"IDpck" INTEGER
"IDkzn" INTEGER
-- пример запроса --
SELECT "Insp", "Acc_num", "Dat", "D", "C", "IDpck", "IDkzn" ');
FROM "Kzn"
WHERE
"Insp" in ('0001','0002') and
"Acc_num" in ('1010510','1400310','030120') and
"Dat" between '12-MAR-2003' and '23-APR-2003'
UNION
SELECT "Insp", "Acc_num", max("Dat") dat, sum("D") D, sum("C") C, 0 IDpck, 0 IDkzn
FROM "Kzn"
WHERE
"Insp" in ('0001','0002') and
"Acc_num" in ('1010510','1400310','030120') and
"Dat" between '12-MAR-2003' and '23-APR-2003'
GROUP BY "Insp", "Acc_num"
order by "Insp","Acc_num" // на этой строке ошибка след (invalid ORDER BY clause)
заранее благодарен за Ваше внимание :о)
-- поля таблицы Kzn --
"Insp" VARCHAR(4)
CHARACTER SET WIN1251 DEFAULT '' COLLATE PXW_CYRL
"Acc_num" VARCHAR(7)
CHARACTER SET WIN1251 DEFAULT '' COLLATE PXW_CYRL
"Dat" DATE
"D" DECIMAL(18,2)
"C" DECIMAL(18,2)
"IDpck" INTEGER
"IDkzn" INTEGER
-- пример запроса --
SELECT "Insp", "Acc_num", "Dat", "D", "C", "IDpck", "IDkzn" ');
FROM "Kzn"
WHERE
"Insp" in ('0001','0002') and
"Acc_num" in ('1010510','1400310','030120') and
"Dat" between '12-MAR-2003' and '23-APR-2003'
UNION
SELECT "Insp", "Acc_num", max("Dat") dat, sum("D") D, sum("C") C, 0 IDpck, 0 IDkzn
FROM "Kzn"
WHERE
"Insp" in ('0001','0002') and
"Acc_num" in ('1010510','1400310','030120') and
"Dat" between '12-MAR-2003' and '23-APR-2003'
GROUP BY "Insp", "Acc_num"
order by "Insp","Acc_num" // на этой строке ошибка след (invalid ORDER BY clause)
заранее благодарен за Ваше внимание :о)
если ты сделаешь ORDER BY 1 то ошибка перестанет появляться. Учите матчасть.