日期:2014-05-17 浏览次数:20490 次
CREATE TABLE `arp_individual` (
`id` int(11) NOT NULL default '0',
`individualid` varchar(60) character set latin1 default NULL,
`sex` int(11) default NULL,
`room` int(11) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `arp_area` (
`id` mediumint(8) NOT NULL auto_increment,
`areaname` longtext,
`nurse` int(11) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2059 DEFAULT CHARSET=utf8;
<?xml version="1.0" encoding="utf-8"?>
<data>
<area id="A01" title="常规治疗1区" value="常规治疗1区,人数:6人,护士:林晓岚" />
<area id="A02" title="常规治疗2区" value="常规治疗1区,人数:5人,护士:林晓岚" />
......
<area id="F09" title="急诊9区" value="急诊9区,人数:8人,护士:张梅颖" />
</data>
SELECT COUNT(*), areaname FROM arp_individual i
LEFT JOIN arp_area a ON i.room = a.id
GROUP BY i.room