Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL: ORDER BY clause is invalid
Message
From
02/04/2005 17:42:46
 
 
To
02/04/2005 16:59:43
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Novell 5.x
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01000629
Message ID:
01001049
Views:
44
<snip>

>2) In previous versions only ordering was done depending on base table field country.
>
>This was a bug in previous versions that might not be accepted as a bug (to ANSI SQL it's a bug).
>

But !!!!! MS SQL
CREATE TABLE #tree (id INT,parentId INT NULL)
INSERT INTO #tree VALUES (1,2)
INSERT INTO #tree VALUES (2,1)

SELECT id AS parentId,parentId as id FROM #tree ORDER BY parentId
-- this return different order !!!
SELECT id AS parentId FROM #tree ORDER BY parentId

DROP TABLE #tree
MS SQL is ANSI SQL ok or not ?

If not, then this is a very bad behaviour,
if yes then ANSI SQL is very bad,
if this is the UNIVERSE SQL standard, it is bad.

Update: i read ANSI SQL92 ORDER BY rules,
it is ok, the column_name it has priority;
then MS SQL is not "ORDER BY" ANSI SQL92 compliant,
i Check SYBASE 9 and it is compliant.

I look a caos into this obvious rule! Incredible.

Someone have a link where exists a backends full comparison ?

Fabio
Previous
Reply
Map
View

Click here to load this message in the networking platform