<?
$strSQL = "select d.thainame, (select top 1 tel from tel where id_detail = d.id_detail) from detail d";
$objQuery = mssql_query($strSQL) or die ("Error Query [".$strSQL."]");
echo $strSQL;
while($objResult = mssql_fetch_array($objQuery))
{
echo "<br>";
echo $objResult["thainame"].$objResult["tel"];
}
?>