表结构如下:
create table date(day varchar(100) not null); create table register(registerCount bigint not null); create table login(loginCount bigint not null);
原sql如下:select day,registerCount,loginCount
from( select day from date where day between 20120101 and 20120103)tmp left join( select registerCount from register)r on tmp.day=r.day left join( select loginCount from login)l on tmp.day=l.day group by day;
原结果集如下:
想更改为如下结果:
水平有限,请高手搭救,要详细sql