<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content="text/html; charset=iso-8859-1" http-equiv=Content-Type> <META name=GENERATOR content="MSHTML 8.00.6001.18828"> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><FONT size=2 face=Arial>yra 2 lentos ir jas joininu</FONT></DIV> <DIV><FONT size=2 face=Arial></FONT> </DIV> <DIV><FONT size=2 face=Arial>SELECT </FONT></DIV> <DIV><FONT size=2 face=Arial> t1.col, </FONT></DIV> <DIV><FONT size=2 face=Arial> t2.col </FONT></DIV> <DIV><FONT size=2 face=Arial>FROM t1 </FONT></DIV> <DIV><FONT size=2 face=Arial>LEFT JOIN t2 ON t1.t2_id = t2.id </FONT></DIV> <DIV><FONT size=2 face=Arial>WHERE t1.year = 2005 </FONT></DIV> <DIV><FONT size=2 face=Arial> AND t2.id = 1</FONT></DIV> <DIV><FONT size=2 face=Arial></FONT> </DIV> <DIV><FONT size=2 face=Arial>jeigu t1.year tokio irasho ner, bet yra t2.id, tai rezultate tureciau gaut visur null. taip?</FONT></DIV> <DIV><FONT size=2 face=Arial></FONT> </DIV> <DIV><FONT size=2 face=Arial>bet jeigu selecte sumetu sias 2 funkcijas: select FORMAT(SUM(t1.col), 2) AS test, t2.col from....</FONT></DIV> <DIV><FONT size=2 face=Arial>tada rodo tablo t2.col eilute, kurios id = 1, o 'test', aisku, null</FONT></DIV> <DIV><FONT size=2 face=Arial></FONT> </DIV> <DIV><FONT size=2 face=Arial>gal nutuokiat kodel ?</FONT></DIV> <DIV><FONT size=2 face=Arial></FONT> </DIV></BODY></HTML>