I have two tables- table1 & table2
I want to join them with 127.0.0.3 SHOWN in NEW TABLE even it have no
hits (in table2)
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;
But if I specify the time ( > 2000 ) using where time>'2001' , I can't
get what my want (Also show 127.0.0.3)
What can the SQL do to do what I want? Many thanks!!
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;
pls read here if you cant see above:
http://www.hk3s.com/db.txt [ edited to preserve formatting using the [code] and [/code]
UBB tags -ds ]
[ July 18, 2003: Message edited by: Dirk Schreckmann ]