title: How to find the minimum value in each row along with column name in sql/hive
body: <p>For example :
  In a table like below:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Id</th>
  <th>Col1</th>
  <th>Col2</th>
  <th>Col3</th>
  <th>Col4</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>10</td>
  <td>29</td>
  <td>40</td>
  <td>74</td>
  </tr>
  <tr>
  <td>2</td>
  <td>14</td>
  <td>19</td>
  <td>41</td>
  <td>11</td>
  </tr>
  <tr>
  <td>3</td>
  <td>9</td>
  <td>19</td>
  <td>47</td>
  <td>77</td>
  </tr>
  <tr>
  <td>4</td>
  <td>27</td>
  <td>79</td>
  <td>43</td>
  <td>70</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>my output should return two columns like the table below:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Id</th>
  <th>Col1</th>
  <th>Col2</th>
  <th>Col3</th>
  <th>Col4</th>
  <th>MinVal</th>
  <th>ColumnName</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>10</td>
  <td>29</td>
  <td>40</td>
  <td>74</td>
  <td>10</td>
  <td>col1</td>
  </tr>
  <tr>
  <td>2</td>
  <td>14</td>
  <td>19</td>
  <td>41</td>
  <td>11</td>
  <td>11</td>
  <td>col4</td>
  </tr>
  <tr>
  <td>3</td>
  <td>9</td>
  <td>19</td>
  <td>47</td>
  <td>77</td>
  <td>9</td>
  <td>col1</td>
  </tr>
  <tr>
  <td>4</td>
  <td>27</td>
  <td>79</td>
  <td>43</td>
  <td>70</td>
  <td>27</td>
  <td>col1</td>
  </tr>
  </tbody>
  </table>
  </div>