mysql> select a.ip,name,time,sum(hits) from table1 a left join table2 b on a.ip= b.ip group by a.ip,a.name;
mysql> select a.ip,name,time,sum(hits) from table1 a left join table2 b on a.ip= b.ip where time>'2001' OR time=null group by a.ip,a.name; [ edited to preserve formatting using the [code] and [/code] UBB tags -ds ] [ July 18, 2003: Message edited by: Dirk Schreckmann ]