The suggested code is preferred (although the ( ) around certificate_key isn't necessary), but the error was due to the fact that you didn't alias your derived table.
-Karl
[red] Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil![/red]
[green]Life's uncertain...eat dessert first...www.deerfieldbakery.com[/green]
Your code does the same, but it does use a derived table. You just forgot to give it a name. I think the code suggested by hmckillop will be more efficient, but maybe the optimizer treats them the same.
-Karl
[red] Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil![/red]
[green]Life's uncertain...eat dessert first...www.deerfieldbakery.com[/green]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.