hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mich Talebzadeh <mich.talebza...@gmail.com>
Subject Re: Query question.
Date Sat, 12 Mar 2016 21:57:23 GMT
That

select (count(*) from Table_X tx where tx.blah = 0.75

will return a single value y and 0.5 * y will be a single value.. Where
does sum come into it. It is normally applied to GROUP BY statements.

Can you provide the original SQL if you have (Oracle, Sybase whatever)?

HTH

Dr Mich Talebzadeh



LinkedIn * https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
<https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw>*



http://talebzadehmich.wordpress.com



On 12 March 2016 at 21:25, ws <wlodek_siebor@yahoo.com> wrote:

> I need to re-write something like this to Hive:
>
> ###
> select  x.A,
> sum(0.5 * (select (count(*) from Table_X tx where tx.blah = 0.75)))
> from Table_X x
> ###
>
> Thanks in advance for any pointer to it.
>

Mime
View raw message