Subject Problems with "Order by"
Author indo2605
Hello,

I have some problems when I use column in an "order by"-statement more
than one time. I have created an test-scenanrio:

CREATE TABLE TEST (
ID1 INTEGER NOT NULL,
CUSTOMER INTEGER NOT NULL,
BILLNO INTEGER NOT NULL,
AMOUNT NUMERIC(15,5),
PRIMARY KEY (ID1));

INSERT INTO TEST(ID1, CUSTOMER, BILLNO, AMOUNT) VALUES (1,1,3,4);
INSERT INTO TEST(ID1, CUSTOMER, BILLNO, AMOUNT) VALUES (2,2,2,5);
INSERT INTO TEST(ID1, CUSTOMER, BILLNO, AMOUNT) VALUES (3,2,4,7);
INSERT INTO TEST(ID1, CUSTOMER, BILLNO, AMOUNT) VALUES (4,1,6,8);
INSERT INTO TEST(ID1, CUSTOMER, BILLNO, AMOUNT) VALUES (5,2,5,9);
INSERT INTO TEST(ID1, CUSTOMER, BILLNO, AMOUNT) VALUES (6,2,7,8);


After excecuting the following SQL-Statement

SELECT CUSTOMER, BILLNO, SUM(AMOUNT) FROM TEST
GROUP BY CUSTOMER, BILLNO
HAVING SUM(AMOUNT) != 0
ORDER BY BILLNO

everything works fine, until I replace the last line with:

ORDER BY BILLNO, BILLNO

It is not correctly sorted anymore (column "BILLNO").

The same behaviour when I use "ORDER BY BILLNO, BILLNO, BILLNO" but
when in use it more then threetimes it works again, e.g. "ORDER BY
BILLNO, BILLNO, BILLNO, BILLNO"

I use Firebird 1.52 and the IBOConsole, have you the same problems? Is
this a known bug?

Thanks,

Ingo