Hi Subhash,
The first query gets translated into two queries:

  Select * From User Where userName = 'sachin' And age < '20'
    and
 Select * From User Where userName = 'sachin' And age > '20'

Thus you need a query ordered by name then age because the equality
filters need to proceed the inequality. So, my guess would be that
your second query:

   Select * From User Where userName = 'sachin' And age = '20'

 works because you have an index ordered by age then name which would
work since your query filters are both equality filters and thus order
in the index is not important.

Hope this helps,
Stephen

On Aug 2, 12:12 am, Subhash <[email protected]> wrote:
> Hi All,
>
> When I am running any GQL with using 'Not Equal To' and 'And' operator
> both the Google App Engine gives the error no matching index found.
>
> For example:
> Select * From User Where userName = 'sachin' And age != '20'
> error
> no matching index found.
>
> This query needs this index:
> - kind: User
>   properties:
>   - name: userName
>   - name: age
>
> But when I run following GQL then it works properly.
> Select * From User Where userName = 'sachin' And age = '20'
>
> Any suggestion/help are appreciated.
>
> Thanks in advance.
>
> Subhash

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to