Help for this page

Select Code to Download


  1. or download this
    SELECT TOP 1 Previous.*
      from People as Previous
      join People as This on Previous.LastName < This.LastName or Previous
    +.LastName = This.LastName and Previous.FirstName < This.FirstName
     WHERE This.ID = 15
     ORDER BY Previous.LastName DESC, Previous.FirstName DESC
    
  2. or download this
    SELECT TOP 1 *
      from People
     WHERE LastName < 'Doe' or LastName = 'Doe' and FirstName < 'Joe'
     ORDER BY Previous.LastName DESC, Previous.FirstName DESC