Doctrine 未知列
我有一个sql:Doctrine 未知列,doctrine,Doctrine,我有一个sql: Doctrine_Query::create() ->select('(t.a+t.b) as c') ->from('mytable t') ->where('t.c > 1'); 它引发未知的c列错误 有人能帮忙吗 我试一下: Doctrine_Query::create() ->select('(t.a+t.b) as c') ->fro
Doctrine_Query::create()
->select('(t.a+t.b) as c')
->from('mytable t')
->where('t.c > 1');
它引发未知的c列错误
有人能帮忙吗
我试一下:
Doctrine_Query::create()
->select('(t.a+t.b) as c')
->from('mytable t')
->orderBy('t.c');
没关系
为什么?我怀疑如果您使用的是MySQL,那是因为WHERE子句不支持计算列,您需要: 在where子句中重复t.a+t.b>1
b使用t.c>1而不是Where子句您需要了解SQL,因为DQL在后台转换为SQL