/*Table structure for table `teams` */
DROP TABLE IF EXISTS `teams`;
CREATE TABLE `teams` (
`id` INT(64) NOT NULL COMMENT '組ID',
`name` INT(64) NOT NULL COMMENT '組ID',
`description` INT(64) NOT NULL COMMENT '組描述',
PRIMARY KEY (`id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8;
/*Table structure for table `user` */
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` INT(64) NOT NULL COMMENT '用戶ID',
`team_id` INT(64) NOT NULL COMMENT '組ID',
PRIMARY KEY (`id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8;
/*Table structure for table `tasks` */
DROP TABLE IF EXISTS `tasks`;
CREATE TABLE `tasks` (
`task_id` INT(64) NOT NULL COMMENT '任務ID',
`user_id` INT(64) NOT NULL COMMENT '用戶ID',
`team_id` INT(32) NOT NULL COMMENT '組ID',
PRIMARY KEY (task_id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8;
要求輸出以下欄位:count(users.id) as user_count,count(tasks.task_id) as tasks_count,name(team),id(team),description(team).
uj5u.com熱心網友回復:
啥意思,沒看懂。轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/68528.html
標籤:MySQL
上一篇:mysql行轉列(日期)
下一篇:今天
