MySQL Forums
Forum List  »  General

Re: SQL Query help needed
Posted by: Peter Brawley
Date: April 26, 2016 06:04PM

Your query spec is still vague. Based on what you've said, this seems to be what you're looking for ...

select if(model='blueline', product_name, if(model like 'blueline%', product_name,'')) as product
from products
where product_name = 'air conditioner';

> I want to do this within a single query without using any sub query

?! Why?

Is this a school exercise?

Options: ReplyQuote


Subject
Written By
Posted
April 22, 2016 01:03PM
April 22, 2016 03:55PM
April 22, 2016 10:45PM
Re: SQL Query help needed
April 26, 2016 06:04PM
April 26, 2016 11:41PM
May 06, 2016 05:40PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.