GAE sql(GQL)格式正确吗? [英] GAE sql (GQL) correct format?

查看:77
本文介绍了GAE sql(GQL)格式正确吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的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)格式正确吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆