假设我有复杂的表达式,我希望重用它。
下面我必须写Complex Expression
2次:
SELECT "Complex Expression" AS V, "Complex Expression" LIKE "%lex%" W
我会写
SELECT "Complex Expression" AS V, V LIKE "%lex%" W
但MySQL发誓。
如何克服?
答案 0 :(得分:0)
也许是这样的:
select * from (
select "Complex Expression" AS V
from table) AS subquery
where V like '%lex%'