Hey
Is there a way to get the number of records by an update-statement before executing the actual update?
I know you can just create a select count(1) statement, but my process needs something more generic.
Hey
Is there a way to get the number of records by an update-statement before executing the actual update?
I know you can just create a select count(1) statement, but my process needs something more generic.
Do you mean something like this? So you can use the Count in the Update statement itself?
WITH p
AS
(
SELECT *,
COUNT(*) OVER() AS C
FROM tbl
WHERE id IN (1,7,8,9)
)
UPDATE P SET Col = C