views:

218

answers:

2

I am trying something like this:

result = db.GqlQuery("SELECT * FROM myDataMode COUNT(Employee) GROUP BY(Department) WHERE Salary > :1"10000)

And I am getting error :

BadQueryError: Parse Error: Expected no additional symbols at symbol count

Can any one please help me.

+4  A: 

GQL isn't SQL. It doesn't have COUNT() or GROUP BY(). See the GQL reference for more information.

Will McCutchen
A: 

Since GQL does not have COUNT and GROUP BY function. so i designed a solution for it : result = db.GqlQuery( SELECT * form Employee)

Make an Array which will have unique Departments from the result :

if result.Department not in array: array.append(result.Department) for department in array: query = db.GqlQuery(SELECT * form Employee WHERE Department = :1,department) print "In" + department + query.count() +"Employees are working"

Pradeep Upadhyay