Link to home
Start Free TrialLog in
Avatar of Wm Allen Smith
Wm Allen Smith

asked on

SQL Query If Statement

Good Day,

I need to  write a  SQL query that goes something  like this:

Select  [apples], [oranges], {bananas],  [price] from Fruit_Tabletable where
 if [price]  >0, then [apples] =Yes and oranges= Yes

I need to only show apples and oranges  where the cost is  grater than zero and have "Yes" appear in the apples and oranges fields .

Please advise.

Thanks,

wasmithpfs
SOLUTION
Avatar of ste5an
ste5an
Flag of Germany 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
ASKER CERTIFIED SOLUTION
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
Avatar of Wm Allen Smith
Wm Allen Smith

ASKER

Thank you for your quick response, Spt_Us . " Are you wanting to 'set' these as yes? " is the scenario that I was aiming for and your solution works perfectly.


Regards,

Wasmithpfs