You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@kylin.apache.org by "liubo@fcyun.com" <li...@fcyun.com> on 2017/10/31 03:58:38 UTC

SQL problems: Expression 'C.ENABLE_DATE' is not being grouped

Hi all,
    My requirement is: 
    enable_date in t_store table means the first day the store registered in our system, it's a new store , otherwise it's a old store.
    so, I write this SQL, "case when c.enable_date =d.dd then 1 else 0 end is_new_store "

    but, it's wrong, the error is: Expression 'C.ENABLE_DATE' is not being grouped

    How to solve this, and ideals? thanks ~





liubo@fcyun.com

Re: SQL problems: Expression 'C.ENABLE_DATE' is not being grouped

Posted by ShaoFeng Shi <sh...@apache.org>.
Right, the grammar is invalid; The 'ENABLE_DATE' is appeared but not
grouped. You can copy the same SQL to Hive, it should also report a similar
error.

A workaround is using Hive view to normalize this "case when" to a new
column, and then use that as a dimension for the Cube.

2017-10-31 11:58 GMT+08:00 liubo@fcyun.com <li...@fcyun.com>:

> Hi all,
>     My requirement is:
>     enable_date in t_store table means the first day the store registered
> in our system, it's a new store , otherwise it's a old store.
>     so, I write this SQL, "case when c.enable_date
> =d.dd then 1 else 0 end is_new_store "
>
>     but, it's wrong, the error is: Expression 'C.ENABLE_DATE'
>  is not being grouped
>
>     How to solve this, and ideals? thanks ~
>
>
>
> ------------------------------
> liubo@fcyun.com
>



-- 
Best regards,

Shaofeng Shi 史少锋