Link to home
Start Free TrialLog in
Avatar of Larry Brister
Larry BristerFlag for United States of America

asked on

MS SQL Server first column with no zero

I have select statement the produces 9 columns

What I need returned is for columns 2 through 9
The results of the first column where the integer value > 0

example... the columns would be
IndividualID       [1]         [2]         [3]  ... etc
95487512         32546      0         33365
95487513             0         33358  33365

The desired final select would be
IndividualID        OPCol
95487512            32546
95487513            33348
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Larry Brister

ASKER

yeah... thats what I thought... was hoping there was some super-secret wonderful thing that was recently invented
Perfect... tanks
>> was hoping there was some super-secret wonderful thing that was recently invented
I don't think so, though I'm curious too :-)  ... but I suspect the multiple columns is going to necessitate a CASE or UNION ALL approach no matter what you do.