Link to home
Start Free TrialLog in
Avatar of elucero
elucero

asked on

sql conditional statement

groupid      measure1      measure3      measure4
2              89                     78                     77
4             87                    77                    77


want to select from tbl1 and return only 1 row
select * from tbl1 where groupid in (select groupid = case when groupid = 4 then 4 else 2 end from tbl1)  - this is still returning 2 rows, I just want 1. I want the 1 with 4 and if 4 isn't there I'll take 2
ASKER CERTIFIED SOLUTION
Avatar of Dale Burrell
Dale Burrell
Flag of New Zealand 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