-2
I would like to select in records greater than 10 thousand and delete after.
select count (FuncionarioID) > 10000 FROM FuncionarioLog;
How should I select correctly?
-2
I would like to select in records greater than 10 thousand and delete after.
select count (FuncionarioID) > 10000 FROM FuncionarioLog;
How should I select correctly?
0
You can always do it this way:
SELECT *
FROM (
SELECT *
, ROW_NUMBER() OVER(ORDER BY Registo ASC) AS Linha
FROM Tabela) X
WHERE Linha <= 10000
In the ORDER BY Registo ASC
we must replace the Registo
by the column by which we want to sort, that is, the one by which the records will be ordered in order to generate the row number (ROW_NUMBER
).
Instead of Tabela
we will obviously have to put the name of our table.
More information on the use of ROW_NUMBER
in the Microsoft documentation: ROW_NUMBER (Transact-SQL)
Browser other questions tagged c# sql select-sql count
You are not signed in. Login or sign up in order to post.
Show!! Helped. Hugs
– Aquila
Perfect :)! Take the opportunity to give an UP on the answer?
– João Martins