Icon View Incident Report

Minor Minor
Reported By: Don Haas
Reported On: 11/1/2004
For: Version 4.14 Build 1
# 1894 SQL TOP Clause Not Working Properly with Sub-SELECTs

I am try to delete X number of bottom rows in a table. So I do a select that gets the Ascending top 10 rows. Then using that select do a delete where the ID are in the select results. The problem is that regardless what if I use ASC or DESC it always deletes the newest rows (highest ID's) instead. I want it to always be the (smallest ID's).

DELETE FROM TABLENAME WHERE ID IN
  (SELECT ID FROM TABLENAME ORDER BY ID ASC TOP 10);



Resolution Resolution
Fixed Problem on 11/2/2004 in version 4.15 build 1
Image