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 <yogeshdh...@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

Reply via email to