qwerin / fusion-tables

Automatically exported from code.google.com/p/fusion-tables
0 stars 1 forks source link

counting how many records start with the same 3 characters #1486

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
So I need to count how many records start with the same 3 characters.

For this table:

code     fullName         status
HEL001   John Smith       confirmed
HEL002   Paul Adams       rejected
HEL004   Ron Swanson      confirmed
HEL005   Daniel Silva     confirmed
AND001   Johnny English   confirmed
AND002   Mary Sweet       rejected
AND005   Linda Still      confirmed

I need to know the number of records where the code starts with HEL and the 
status is confirmed.

I though that sending the query
SELECT LEFT(code, 3) AS 'HEL', COUNT() FROM TABLE_ID WHERE status='confirmed'
would work but it doesn't and I get the following error:
400 Bad Request Invalid query: Parse error near 'SELECT' (line 1, 
position 0)

Is there any way to do what I want?

Original issue reported on code.google.com by hasl...@gmail.com on 21 Jun 2015 at 5:44