"Thalis A. Kalfigopoulos" <thalis(at)cs(dot)pitt(dot)edu> writes:> Any ideas why the one would fail while the other would work?
The first one is wrong.
Hint: the loop executes zero times if the SELECT doesn't find anything.
regards, tom lane