We just came across this in an old production stored proc (there is a lot more going on in here, but this is in one leg of its logic). Why would someone ever select top 0 rows from a table? Is this some sort of SQL hack or trick I am not familiar with?
To name columns in a UNION ALL
Be sure to read Alex K.'s answer as well. He has a lot of reasons that I have used as well. This was just the most obvious one.
2.1m questions
2.1m answers
60 comments
57.0k users