Skip to content

Tag: sql-server

SQL select single row number x only

For processing SQL data in VBA I want to use a loop (For…Next) that reads line by line from a SQL database. As records were deleted the ID column has gaps. The table looks for example like this: Having four lines I would like to run of course a “For each” would do good, too. Answer If you wa…

SQL delete except select result

I have these 3 tables, and i want to delete from all records except some already used request Registry Record Request and i use this query which brings me all the rows i want to delete. How to use delete in this case? Answer