Quantcast
Channel: OutSystems Community
Viewing all articles
Browse latest Browse all 1476385

[Forums] SQL - Delete first 1000 records

$
0
0

Hi Louise,

It depends on your underlying database. Assuming you use MSSQL Joao's answer is correct (but see below). If you have MySQL, you can use LIMIT. I'm not sure if Oracle supports TOP, if not use ROWNUM <= 1000.

Also note that if you do not specify an ORDER, the database may delete any 1000 rows as it sees fit (Microsoft mentions "a random selection", though I'm not sure how random that actually is). If you want to delete the first 1000, use ORDER BY Id (or whatever your Id column is called).


Viewing all articles
Browse latest Browse all 1476385


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>