select records with max date
<p>I have a table like below :</p>

<pre><code>Id  fkEmp_id  Date          Type
1     1       2016-08-20      1
2     2       2016-08-28      1
3     2       2016-08-30      0
</code></pre>

<p>I want to  select  records based on "Type"  &lt;>  0 and the " Date " should be Maximum  Date  for each employees.</p>

<p>I try the query below :</p>

<pre><code>select *  from table where Type &lt;&gt; 0 and fkEmp_Id = 2 order by max(Date)
</code></pre>

<p>But the result is look like below :</p>

<pre><code> Id  fkEmp_id   Date           Type 
  2    2         2016-08-28     1
</code></pre>

<p>If the Type is 1 and the Date is Max for each FkEmp_id then only I want to fetch the records . How to do that? Please help me.</p>