I just ran across this in an SP and I thought I’d share it with you guys…
Select RegionName from Regions
where RegionName IN (‘SC’, ‘MW’, ‘NE’, ‘NC’, ‘NW’)
For some reason, I just love the uselessness of this whole thing.
I just ran across this in an SP and I thought I’d share it with you guys…
Select RegionName from Regions
where RegionName IN (‘SC’, ‘MW’, ‘NE’, ‘NC’, ‘NW’)
For some reason, I just love the uselessness of this whole thing.
Comments are closed.
There is a sense in that. Imagine the following table contents:
insert into Regions (RegionName)
select ‘SC’ union
select ‘NW’ union
select ‘NA’
Now try your query. As you can see, output will be limited by both IN() list and table data. But yes, I doubt that authors of such crap ever think about this weird case… 🙂
Do I need to be American to understand the uselessness of this sp?