Re: Finding Max of a column without using any Aggregation functions

2014-04-23 Thread Furcy Pin
Ok, At any rate, you could replace your dummy join by a cross join: SELECT nfr.score FROM student nfr LEFT OUTER JOIN ( SELECT a.score as fra FROM student a CROSS JOIN student b WHERE a.score < b.score ) frab ON frab.fra = nfr.score WHERE

Re: Finding Max of a column without using any Aggregation functions

2014-04-23 Thread Sanjay Subramanian
Thanks For the sake of this question I wanted to avoid all order by and limit syntax 😄. It's more of a challenge question Regards Sanjay Sent from my iPhone > On Apr 23, 2014, at 2:51 AM, Furcy Pin wrote: > > Hi, > > note that if your table contains the max value several time, all the > o

Re: Finding Max of a column without using any Aggregation functions

2014-04-23 Thread Furcy Pin
Hi, note that if your table contains the max value several time, all the occurences will be returned. Note also that if it contains a null it will be returned too. How about this? SELECT score FROM student ORDER BY score DESC LIMIT 1 ; Note that on this query Impala is incoherent with Hive or

Finding Max of a column without using any Aggregation functions

2014-04-22 Thread Subramanian, Sanjay (HQP)
Hey guys TABLE=STUDENT COLUMN=SCORE U want to find the max value in the column without using any aggregation functions. Its easy in a RDB context but I was trying to get a solution in Hive (clearly I have some spare time on my hands - LOL) select nfr.score from student nfr left oute