我有四张桌子,这里是
CREATE TABLE `table1` (
`id` int(22) NOT NULL auto_increment,
`createdDate` date NOT NULL,
`created_by` int(44) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=21 ;
CREATE TABLE `table2` (
`id` int(99) NOT NULL auto_increment,
`CompanyName` varchar(99) NOT NULL,
`createdDate` date NOT NULL,
`created_by` int(44) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=19076 ;
同理table3和table4
我想显示这样的结果
Date | userid |Total_of_table1 | Total_of_table2 |Total_of_table3
2013-03-11 | 1 |20 |23 |24
这个查询将如何?简单的是用户在每个表中的总计日期(天)