Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DESCENDING make SQL result weird
Message
From
16/12/1996 23:19:42
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
DESCENDING make SQL result weird
Miscellaneous
Thread ID:
00015301
Message ID:
00015301
Views:
92
I just made a weird discovery in a SQL syntax.

In one application, I was using this syntax for a SQL:

SELECT NUMERO,VISIT FROM MEMBER WHERE NUMERO=1 GROUP BY NUMERO ORDER BY VISIT DESCENDING

But since I only have unique NUMERO in my MEMBER table, there was no need to have the GROUP. So I remove the GROUP and ended up like this:

SELECT NUMERO,VISIT FROM MEMBER WHERE NUMERO=1 ORDER BY VISIT DESCENDING

Now, the result is weird and look like if a corruption was in the table because I end up with two records having NUMERO=1. But, what make it look like a corruption is that on my second record the NUMERO is blank.

So, I first thought it was a corruption so I did these steps:

SELECT * FROM MEMBER INTO TABLE TEMP
ERASE MEMBER.*
RENAME TEMP.* TO MEMBER.*
USE MEMBER EXCL
DELETE TAG ALL
reindex all my tags
redo the SQL #2
and obtained the same result

The problem is really when using DESCENDING because if I remove the DESCENDING, I won't have any problem:

SELECT NUMERO,VISIT FROM MEMBER WHERE NUMERO=1 ORDER BY VISIT

Is there really a bug with DESCENDING?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Reply
Map
View

Click here to load this message in the networking platform