title: how do retrieve specific row in Hive?
body: <p>I have a dataset looks like this:</p>
  
  <pre><code>---------------------------
   cust | cost | cat   | name
  ---------------------------
    1   |  2.5 | apple | pkLady
  ---------------------------
    1   |  3.5 | apple | greenGr
  ---------------------------
    1   |  1.2 | pear  | yelloPear
  ----------------------------
    1   |  4.5 | pear  |  greenPear
  -------------------------------
  </code></pre>
  
  <p>my hive query should now compare the cheapest price of each item the customer bought. So I want now to get the 2.5 and 1.2 into one row to get its difference. Since I am new to Hive I don't now how to ignore everything else until I reach next category of item while I still kept the cheapest price in the previous category. </p>