Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Easy Query Question

Status
Not open for further replies.

newB11

Programmer
Joined
Dec 16, 2003
Messages
1
Location
US
Please help me since I'm new and dumb. How can I take the returned values from a stored procedure and replace them with something else? I want a query that returns '1' in the 'Status' column to display 'Apples', instead, and I want it to show 'Oranges' for every instance of '2'. It should be very simple but I'm stuck. Thanks!
 
Code:
select case status 
    when '1' then 'Apples'
    when '2' then 'Oranges'
    else 'fruit salad' end
  from t

You should be able to adapt that to your needs.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top