Is it possible to capture data from a WHERE clause?

Posted by Kristopher Ives on Stack Overflow See other posts from Stack Overflow or by Kristopher Ives
Published on 2010-06-13T07:05:27Z Indexed on 2010/06/13 7:12 UTC
Read the original article Hit count: 171

Filed under:
|
|

I have a scenario where I'm calculating something in the WHERE clause of my SQL, but I also want to get that calculation - since it's expensive. Is it possible to get the results of something done in the WHERE clause, like this:

SELECT `foo` FROM `table` WHERE (foo = LongCalculation())

Wishful thinking, or possible with MySQL?

© Stack Overflow or respective owner

Related posts about sql

Related posts about mysql