MySQL Forums
Forum List  »  InnoDB

Using the compared value
Posted by: Stephen Barton
Date: September 30, 2008 05:54AM

Hi,
I am using an 'IF' function in a query, and I need a little help. The value in the condition is an integer that is the result of a rather complex query:

IF(
(SELECT....
..........
..........) < 0, 'N/A', (SELECT....
..........
..........)
)

So is there a better way than running the SELECT query twice? Once for the comparison and again for the value?

Many thanks,
Stephen

Options: ReplyQuote


Subject
Views
Written By
Posted
Using the compared value
2683
September 30, 2008 05:54AM
1936
September 30, 2008 08:23AM
1888
September 30, 2008 08:23AM
1877
October 01, 2008 12:35AM


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.