Sri Lanka .NET 
       Forum Member

Monday, November 26, 2007

Get only one ( top most) record from relation table.

select
(select flightnumber as fn
from routing r
where r.involvedinformationid=ii.id
and r.id=(select MIN(id) from routing where involvedinformationid=r.involvedinformationid)),ip.*, ii.*
from involvedperson ip left outer join involvedinformation ii on ip.id=ii.involvedpersonid
where ip.emergencysituationcaseid=561