Median number from table of number:count format


  • 0
    B

    Given a table:

    +------------+-----------+
     |  Number   |  Count    |
    +------------+-----------+
     |  0        |  7        |
    +------------+-----------+
     |  1        |  1        |
    +------------+-----------+
     |  2        |  3        |
    +------------+-----------+
     |  3        |  1        |
    +------------+-----------+
    

    Which is representing such a number sequence:
    0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 3

    find the median number, in this case it's 0, with sql.
    You will need to run this query in hive (qubole)

    Thoughts?


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.