1.SELECT t1.fields,t2.column1,t2.column2 FROm table1 t1LEFT OUTER JOIN table2 t2ON t2.LinkCol=t1.LinkColLEFT OUTER JOIN (SELECT LinkCol,{MAX/MIN}(integerCol) AS ReqdValue FROm table2 t2 GROUP BY LinkCol) t3ON t2.LinkCol=t3.LinkColAND t2.integerCol=t3.ReqdValue
you can use MIN or MAX based on your rule to fetch latest or first information based on IntegerColumn in table 2. LinkCols in table1 & table2 are columns by which they can be joined.now for second part just do this2.SELECT t1.fields,COALESCE(t2.RowCount,0)FROm table1 t1LEFT OUTER JOIN (SELECT LinkCol,COUNT(PKCol)) AS RowCount FROm table2 t2 GROUP BY LinkCol) t2ON t2.LinkCol=t1.LinkCol