标签: mysql sql select
我想写一些像这样的小选择
select t.id,func(t.name) from table t where func(t.name)>0
但我想只调用一次函数func
func
有人能帮助我吗?
答案 0 :(得分:0)
使用HAVING:
HAVING
SELECT t.id, func(t.name) AS f FROM Table AS t HAVING f > 0