mySQL 与 sqlite 别名不兼容?
我使用 Yii 框架和 mySQL 以及 ORM。当我切换到 sqlite 时,我突然收到查询中具有别名的列的“未找到列”错误:
Querying SQL: SELECT `privateAccesses`.`project_id` AS `t1_c0`, ... FROM `project` `privateAccesses`
然后我得到:
CDbException: CDbCommand failed to prepare the SQL statement: SQLSTATE[HY000]: General error: 1 no such column: privateAccesses
所以我认为这与别名有关..任何人都知道 mySQL/sqlite 别名是否以某种方式存在不相容?知道如何解决这个问题吗?基本别名似乎可以在 sqlite 中使用..
谢谢, B先生
I use Yii framework with mySQL with an ORM. When I switch to sqlite, I suddenly get 'column not found' errors for columns that have aliases in their query:
Querying SQL: SELECT `privateAccesses`.`project_id` AS `t1_c0`, ... FROM `project` `privateAccesses`
Then I get:
CDbException: CDbCommand failed to prepare the SQL statement: SQLSTATE[HY000]: General error: 1 no such column: privateAccesses
So I think it has something to do with aliases.. anyone know if the mySQL/sqlite aliases are somehow incompatible? Idea how to fix this? Basic aliases seem to work in sqlite..
Thanks,
MrB
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
算了,ORM 出于某种原因省略了 sqlite 上的某些列。
Forget it, it's something about the ORM omitting certain columns on sqlite for some reason..