title: Lowest salaried employee sql server - not working with MIN function
body: <p>I have ended up with a peculiar problem. I am not able to find out the root cause of the issue. Please help.</p>
  
  <p>please create a table by executing below scripts</p>
  
  <pre><code>CREATE TABLE Employee_salary (ID INT,emp_name VARCHAR(50),Salary INT)
  
  INSERT INTO Employee_salary VALUES(1,'Dolu',15000)
  INSERT INTO Employee_salary VALUES(2,'Bolu',15000)
  INSERT INTO Employee_salary VALUES(3,'Kalia',10000)
  INSERT INTO Employee_salary VALUES(4,'Bheem',50000)
  INSERT INTO Employee_salary VALUES(5,'Krishna',40000)
  INSERT INTO Employee_salary VALUES(6,'Chutki',30000)
  
  SELECT * FROM Employee_salary
  
  ID  emp_name    Salary
  1   Dolu        15000
  2   Bolu        15000
  3   Kalia       10000
  4   Bheem       50000
  5   Krishna     40000
  6   Chutki      30000
  </code></pre>
  
  <p>I wanted highest salaried employee, so I found bwlow query</p>
  
  <pre><code>SELECT Top 1 emp_name,MAX(salary) from Employee_salary  Group by emp_name
  </code></pre>
  
  <p>I tried to found Lowest salaried employee and tried executing below query by changing 'MAX' to 'MIN'. Surprisingly the below query is not working in any ways. Still it shows 'Bheem, 50000' which is a wrong answer. Can anybody tell me the cause or reason for this issue.</p>
  
  <pre><code>SELECT Top 1 emp_name,MIN(salary) from Employee_salary  Group by emp_name
  </code></pre>