Hi Rahul, 1) Restructure your model so that you can query using only equality filters and the order. 2) If your data allows it, don't filter based on property_x in the query, do it in your code. You might need to fetch 10 entities, and possibly even re-fetch once or twice, but that will probably still use fewer resources than always running multiple queries -- which is what your current solution does. 3) Or if these are root entities, set the key_name to property_y and don't use order for the query, the entities will be ordered by key.
If possible, I would probably go with the first or second option. You'll have to decide based on which fits your data better. Robert On Wed, Dec 29, 2010 at 20:32, rahul jain <jainwolver...@gmail.com> wrote: > I am getting this error when executing this sql > > db.GqlQuery("select * from <kind_name> WHERE <propert_name_x> != :val > ORDER BY <property_name_y> DESC LIMIT 5 ", val="blah") > > BadArgumentError: First ordering property must be the same as > inequality filter property, > > I know this is because of two diff. property name I am using > > > <propert_name_x> > <property_name_y> > > But I would to have the query that way, gives me the first 5 items > based on <property_name_y> but should not include <propert_name_x>. > > How to resolve this ? > > Thanks. > > --RJ > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to google-appeng...@googlegroups.com. > To unsubscribe from this group, send email to > google-appengine+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.