
hmm - decode won't work afterall
upon rereading the puzzle, the decode solution wouldn't work. The requirement is > 0 turns into 1, which implies <= 0 turns to 0. The decode solution would have turned anything <> 0 into 1. It'll work if the data can only contain non-negative values, but we probably shouldn't make that assumption even though the sample doesn't include negative values.
Based on that, your solution would work with a minor change of <= 0 in the 2nd select's where clause.
Also welcome to the group! How'd you find us?
Darrell Spice, Jr. [link|http://spiceware.org/gallery/ArtisticOverpass|Artistic Overpass]\n[link|http://www.spiceware.org/|SpiceWare] - We don't do Windows, it's too much of a chore