query to find the lower values of two columns for sql server

I have the following table columns .  
emp_no, bonus1, bonus2

I like a simple sql to find the lower value of bonus1 and bonus2, so the out_put is:
emp_no, lower_of_bonus1_bonus2
ewang1205Asked:
Who is Participating?
 
Daniel ReynoldsConnect With a Mentor Software Applications Developer / IntegratorCommented:
Something like the following

Select emp_no, Case When bonus1 < bonus2 Then bonus1 Else bonus2 end
from mytable
0
 
brad2575Connect With a Mentor Commented:
try this:
select emp_no, case when bonus1 < bonus2
            then bonus1
            else bonus2 end as lower_of_bonus1_bonus2
  from TableName

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.