phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabriel Reid <gabriel.r...@gmail.com>
Subject Re: How to query select count distinct with Phoenix
Date Mon, 16 Jun 2014 08:27:13 GMT
Hi,

Count is a function, so you need to wrap its parameters with
parentheses (see
http://phoenix.apache.org/language/functions.html#count for the exact
grammar).

Writing your query as "select count(distinct id) from session" should
resolve this issue.

- Gabriel

On Mon, Jun 16, 2014 at 9:54 AM, Pham Phuong Tu <tuphamphuong@gmail.com> wrote:
> Hi guys,
>
> I cann't run this type of query with Phoenix
>
> - Phoenix shell
>
>> select count distinct (id) from session;
>
>> Error: ERROR 601 (42P00): Syntax error. Encountered "distinct" at line 1,
>> column 14. (state=42P00,code=601)
>
>
> But this query still ok
>
>>  select distinct (id) from session;
>
> Please tell me how to do this, thanks.
>
> --
> -----------------------------------------
>
> Pham Phuong Tu
> Back-end & Big data developer
> Skype: phamphuongtu

Mime
View raw message