title: SQL Server last date
body: <p>Is there an option for getting the row with the highest date without joining the same table and use max(date) ?? Is Top1 order by desc a valid option ?</p>
  
  <p>I use SQL Server 2000. And performance is important.</p>
  
  <p>edit:</p>
  
  <p>Table1:</p>
  
  <pre><code>columns: part - partdesc
  </code></pre>
  
  <p>Table 2:</p>
  
  <pre><code>columns: part - cost - date
  
  
  select a.part,partdesc,b.cost
  left join( select cost,part 
             right join(select max(date),part from table2 group by part) maxdate ON maxdate.date = bb.date  
             from table2 bb ) b on b.part = a.part
  from table1
  </code></pre>
  
  <p>I don't know if the code above works but that is the query I dislike. And seems to me inefficient.</p>