问题描述
我的sql看起来像这样:
My sql looks like this :
SELECT * FROM Contact_Info_Entry其中Name.length< 18
SELECT * FROM Contact_Info_Entry where Name.length < 18
[得到了不正确的GQL语法错误消息]
[ Got incorrect GQL syntax error message ]
名称"是Contact_Info_Entry.java类中的一个字符串,我对sql不熟悉,更不用说GQL了,如果我要选择所有长度少于18个字符的名称,那么要使用的正确GQL语法是什么? /p>
"Name" is a String in the Contact_Info_Entry.java class, I'm not familiar with sql, let alone GQL, if I want to select all names less than 18 characters long, what's the correct GQL syntax to use ?
推荐答案
您无法使用GQL过滤字段的长度.
You can't filter by a field's length with GQL.
但是,如果对模型进行非规范化并将长度Name
作为字段包含在模型中,则可以实现此目的.
However, you could achieve this if you denormalize your model and include the length of Name
as a field in your model.
这篇关于GAE sql(GQL)格式正确吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!