hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bejoy KS" <bejoy...@yahoo.com>
Subject Re: ERROR: Hive subquery showing
Date Thu, 27 Sep 2012 19:48:25 GMT
Hi yogesh

What about a query like this
select name from ABC WHERE grp=MAX(grp); 


Regards
Bejoy KS

Sent from handheld, please excuse typos.

-----Original Message-----
From: Chen Song <chen.song.82@gmail.com>
Date: Thu, 27 Sep 2012 15:33:11 
To: <user@hive.apache.org>
Reply-To: user@hive.apache.org
Subject: Re: ERROR: Hive subquery showing

Can you try this?
*
*
*select name from ( select MAX(grp) as name from ABC ) gy ;*

On Thu, Sep 27, 2012 at 3:29 PM, yogesh dhari <yogeshdhari@live.com> wrote:

>  Hi all,
>
> I have a table called ABC, like
>
> name    grp
> A             1
> B             2
> C             4
> D             8
>
> I want the output like the name having greatest grp i.e D;
>
> I wrote a query:
> *
> select name from ( select MAX(grp) from ABC ) gy ;*
>
> but it gives error
>
> FAILED: Error in semantic analysis: Line 1:7 Invalid table alias or column
> reference 'name': (possible column names are: _col0)
>
> Please help and suggest why it is so, and what would be the query;
>
>
> Thanks & regards
> Yogesh Kumar
>
>
>
>
>
>


-- 
Chen Song

Mime
View raw message