0

I want to find all employees from a company where the telephone number is NOT empty.

Now I have this:

db.GqlQuery('SELECT * FROM Employee '
       'WHERE company = :company '
       'AND phone > :nophone', company=company, nophone=None)

But this always prints out empty results although there are items with telephone number.

Cheeso
  • 189,189
  • 101
  • 473
  • 713
Elias
  • 3,300
  • 4
  • 34
  • 38
  • Does the same query without the filter on 'phone' return any results? Can you provide the model definition and some sample data? – Nick Johnson Nov 19 '10 at 04:47

1 Answers1

0

try to use

db.GqlQuery('SELECT * FROM Employee  '
  'WHERE company = :company '
  'AND phone != :nophone', company=company, nophone=None)

read more about the operators here

Cheeso
  • 189,189
  • 101
  • 473
  • 713
dirbacke
  • 2,861
  • 21
  • 25