SQL Server Performance

Converting basic EffDt query to SQL 92 standard

Discussion in 'T-SQL Performance Tuning for Developers' started by m26nyc2004, Jan 28, 2005.

  1. m26nyc2004 New Member

    How would I convert this query to ANSI 92 standard?

    select p.InternalID,
    n.LastName
    from tblPatient p,
    tblName n
    where p.PatientID = n.EntID and
    n.EffDt = (
    select max(n2.EffDt) from tblName n2 where n.EntID = n2.EntID and n2.EffDt <= getdate()
    )
  2. FrankKalis Moderator

  3. FrankKalis Moderator

    Oh, one more. You should be explicite on you INNER JOIN and move the join condition away from the WHERE clause. [<img src='/community/emoticons/emotion-1.gif' alt=':)' />]<br /><br />--<br />Frank<br /<a target="_blank" href=http://www.insidesql.de>http://www.insidesql.de</a><br />

Share This Page