Shuli Posted March 8, 2020 Share Posted March 8, 2020 Hi, How can I show string results as characters in sql plus? select* from example a where a.insert_time>='12-dec19' and a.status=1 as 'Cars I want that if 'status' field status result would show '1' the the output would show 'Cars' and if the result would show '2' the the output would show 'Bikes' instead of strings. Best regards Link to comment Share on other sites More sharing options...
dsonesuk Posted March 8, 2020 Share Posted March 8, 2020 There is a sql function CASE that works similar to if else https://www.w3schools.com/sql/sql_case.asp Link to comment Share on other sites More sharing options...
Makwana Prahlad Posted March 11, 2020 Share Posted March 11, 2020 try is select * from example where(case when a.insert_time>='12-dec19' and a.status =1 as cars end); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now