Q:

Alternative way to write IN clause in GQL

How to write below query in GQL 

select * from test WHERE lid=1234 AND status IN (1,7,8)  order by sent_datetime DESC

Exception while executing above query :GQL query error: Encountered "IN" at line 1, column 46. Was expecting one of: "contains", "has", "is", "=", "<", "<=", ">", ">=", ".", "("
And all the columns are indexed.
Thanks

A:

IN is a feature of some client libraries and isn't strictly part of the GQL language of the server. You can do the same thing that the client libraries do to emulate this feature by issuing a query for each value in the IN clause and dedup results.
So this:
select * from test WHERE lid=1234 AND status IN (1,7,8) order by sent_datetime DESC

Would become these:
select * from test WHERE lid=1234 AND status = 1 order by sent_datetime DESC
select * from test WHERE lid=1234 AND status = 7 order by sent_datetime DESC
select * from test WHERE lid=1234 AND status = 8 order by sent_datetime DESC

