- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
以下是我的 SQL 数据结构,我正在尝试如下两个查询:
Select
Wrk_ID, Wrk_LastName, Skill_Desc
from
Worker, Skill
where
(UPPER(skill_desc) = UPPER('Map Designer') or
UPPER(skill_Desc) = UPPER('Game Designer'));
我得到了所需输出的两倍
select
wrk_ID, concat('Wrk_FirstName','Wrk_LastName') As FullName,
COUNT(Assign_ID) as Max_Assignment
from
assignment worker
group by
Wrk_ID, concat('Wrk_FirstName','Wrk_LastName');
在此查询中,我获取的是 wrk_firstname
和姓氏,而不是名字和姓氏的实际数据。
--
-- Dumping data for table `region`
--
INSERT INTO `region` (`Reg_ID`, `Reg_desc`) VALUES
('R0010', 'California'),
('R0011', 'Nevada'),
('R0012', 'Arizona'),
('R0013', 'Michigan'),
('R0014', 'New York'),
('R0015', 'Texas'),
('R0016', 'Washington'),
('R0017', 'Oregon'),
('R0018', 'Ohio'),
('R0019', 'Boston');
-- --------------------------------------------------------
--
-- Table structure for table `client`
--
INSERT INTO `client` (`Cli_ID`, `Cli_FirstName`, `Cli_LastName`, `Cli_Initial`, `Cli_StreetAddress`, `Cli_Sex`, `Cli_Phone`,`Reg_ID`) VALUES
('C0010', 'Krishneel', 'Sharma', 'V', '99 Rock Road', 'M', '844-2573', 'R0010'),
('C0011', 'Ravneel', 'Sharma', 'V', 'Cecil Street', 'M', '894-1238', 'R0011'),
('C0012', 'Brad', 'Pitt', 'W', '615 Devil Road', 'M', '894-2285', 'R0012'),
('C0013', 'Tom', 'Cruz', 'F', '615 Gorge Town', 'M', '894-2180', 'R0013'),
('C0014', 'Paul', 'Walker', 'F', '615 Gran Street', 'M', '222-1672', 'R0014'),
('C0015', 'Jeniffer','Lopez', 'B', '713 Tall Road', 'F', '442-3381','R0015'),
('C0016', 'Brown', 'James', 'G', '615 South Place', 'F', '297-1228', 'R0016'),
('C0017', 'Lady', 'Gaga', 'G', '615 Hill Road', 'F', '290-2556', 'R0017'),
('C0018', 'Cristiano', 'Ronaldo', 'G', '713 Magic Road', 'M', '382-7185', 'R0018'),
('C0019', 'Lioneil', 'Messi', 'K', '615 Well Street', 'M', '297-3809', 'R0019');
-- --------------------------------------------------------
--
-- Table structure for table `worker`
--
INSERT INTO `worker` (`Wrk_ID`, `Wrk_FirstName`, `Wrk_LastName`, `Wrk_Initial`, `Wrk_HireDate`, `Wrk_BirthDate`, `Wrk_Phone`, `Wrk_IRD_Num`, `Reg_ID`) VALUES
('W0010', 'Rhonda', 'Lewis', 'G', '2000-03-21', '1985-02-19', '855-2573', 'X993473419', 'R0010'),
('W0011', 'Rhett', 'VanDam', 'V', '2002-03-19', '1985-01-11', '994-1238', 'X993473500', 'R0011'),
('W0012', 'Anne', 'Jones', 'M', '2000-04-11', '1965-08-19', '894-9985', 'X9934735001', 'R0012'),
('W0013', 'John', 'Lange', 'P', '2000-04-12', '1975-05-17', '894-5680', 'X993473502', 'R0013'),
('W0014', 'Robert', 'Williams', 'D', '2004-05-19', '1978-03-02', '244-1672', 'X993473503', 'R0014'),
('W0015', 'Jeanine','Smith', 'K', '2005-06-19', '1988-07-04', '434-3381', 'X993473506', 'R0015'),
('W0016', 'Brown', 'James', 'G', '2006-03-19', '1982-06-28', '297-1232', 'X993473507', 'R0016'),
('W0017', 'Jorge', 'Diante', 'K', '2007-01-19', '1984-11-19', '222-2556', 'X993473508', 'R0017'),
('W0018', 'Paul', 'Wiesenbach', 'R', '2007-01-19', '1976-12-12', '389-7185', 'X993473509', 'R0018'),
('W0019', 'Leighla', 'Genkazi', 'W', '2007-01-19', '1989-04-30', '292-3809', 'X993473600', 'R0019');
-- --------------------------------------------------------
--
-- Dumping data for table `project`
--
INSERT INTO `project`(`Proj_ID`,`Proj_Desc`,`Proj_Est_Start`,`Proj_Est_Finish`,`Proj_Cost`,`Proj_Act_Start`,`Proj_Act_Finish`,`Proj_Act_Cost`,`Cli_ID`) VALUES
('P0010','Map Design','2015-04-01','2015-04-30',10000.00,'2015-04-05','2015-05-01',12000.50,'C0010'),
('P0011','Level Design','2015-03-02','2015-03-15',5000.00,'2015-03-02','2015-03-15',7500.00,'C0011'),
('P0012','Controlls Design','2015-04-20','2015-05-01',20000.00,'2015-04-21','2015-04-30',20500.00,'C0012'),
('P0013','Character Design','2015-04-15','2015-05-11',30000.00,'2015-04-15','2015-05-12',50000.00,'C0010'),
('P0014','Sound Design','2015-01-01','2015-04-30',5000.00,'2015-01-10','2015-04-30',97560.00,'C0013'),
('P0015','Game Play design','2015-03-20','2015-03-30',57000.00,'2015-03-20','2015-03-25',6500.00,'C0014'),
('P0016','Server Design','2015-04-01','2015-04-30',89000.00,'2015-04-01','2015-04-30',8900.00,'C0015'),
('P0017','Online Gamplay Design','2015-05-01','2015-05-15',10000.00,'2015-05-02','2015-05-16',10000.00,'C0016'),
('P0018','Software Design','2015-04-01','2015-04-15',15000.00,'2015-04-01','2015-04-15',14500.00,'C0019'),
('P0019','Game programming','2015-01-14','2015-05-01',125000.00,'2015-01-14','2015-05-01',125000.00,'C0019');
-- --------------------------------------------------------
--
--Dumping data for table `assignment`
--
INSERT INTO `assignment`(`Assign_ID`,`Assign_Desc`,`Assign_Est_Start`,`Assign_Est_Finish`,`Assign_Act_Start`,`Assign_Act_Finish`,`Wrk_ID`,`Proj_ID`) VALUES
('A0010','Design Game maps','2015-03-15','2015-04-20','2015-03-15','2015-04-20','W0010','P0010'),
('A0011','Design All levels of Game','2015-03-02','2015-03-15','2015-03-02','2015-03-15','W0012','P0011'),
('A0012','Design Controls For all Platforms','2015-05-01','2015-05-20','2015-05-02','2015-05-21','W0013','P0012'),
('A0013','Design All Character of Game','2015-04-05','2015-04-30','2015-04-05','2015-05-01','W0014','P0013'),
('A0014','Game music Soundtracks','2015-01-03','2015-04-25','2015-02-05','2015-04-30','W0015','P0014'),
('A0015','Virtual walk through of game','2015-03-15','2015-03-30','2015-03-15','2015-03-30','W0016','P0015'),
('A0016','MultiPlayer Game Design','2015-04-02','2015-04-28','2015-04-04','2015-04-30','W0017','P0016'),
('A0017','Online Hosting Design','2015-05-01','2015-05-16','2015-05-01','2015-05-30','W0018','P0017'),
('A0018','Game Interesction Design','2015-04-01','2015-04-15','2015-04-01','2015-04-15','W0011','P0018'),
('A0019','Game codes','2015-01-14','2015-05-05','2015-01-14','2015-05-05','W0019','P0019');
-- --------------------------------------------------------
--
----Dumping data for table `task`
--
INSERT INTO `task`(`Task_ID`,`Task_Desc`,`Task_Act_Start`,`Task_Act_Finish`,`Assign_ID`) VALUES
('T0010','Impliment Map Design','2015-03-15','2015-04-20','A0010'),
('T0011','Impliment game Levels','2015-03-02','2015-03-15','A0011'),
('T0012','Impliment Game Controls','2015-05-02','2015-05-21','A0012'),
('T0013','Impliment Game Characters','2015-02-05','2015-04-30','A0013'),
('T0014','Impliment Sound Design','2015-03-15','2015-03-30','A0014'),
('T0015','Impliment Gamplay designs','2015-04-04','2015-04-30','A0015'),
('T0016','Office Management Systems','2015-05-01','2015-05-30','A0016'),
('T0017','Impliment Multiplayer Gamplay','2015-04-01','2015-04-15','A0017'),
('T0018','Impliment Online Servers','2015-01-14','2015-05-05','A0018'),
('T0019','Impliment all Game Codes','2015-01-14','2015-05-05','A0019');
-- --------------------------------------------------------
--
----Dumping data for table `invoice`
--
INSERT INTO `invoice`(`Inv_ID`,`Inv_Amount`,`Inv_Due_Date`,`Proj_ID`) VALUES
('I0010',12000.50,'2015-04-30','P0010'),
('I0011',7500.00,'2015-03-31','P0011'),
('I0012',20500.00,'2015-04-30','P0012'),
('I0013',50000.00,'2015-05-30','P0013'),
('I0014',97560.00,'2015-05-30','P0014'),
('I0015',6500.00,'2015-04-30','P0015'),
('I0016',8900.00,'2015-05-30','P0016'),
('I0017',10000.00,'2015-05-30','P0017'),
('I0018',14500.00,'2015-04-30','P0018'),
('I0019',125000.00,'2015-05-15','P0019');
-- --------------------------------------------------------
--
----Dumping data for table `skill`
--
INSERT INTO `skill` (`Skill_ID`,`Skill_Desc`,`Skill_PayRate`) VALUES
('S0010','Map Designer',55.00),
('S0011','Level Designer',40.00),
('S0012','Game Designer',65.00),
('S0013','Graphics Designer',55.00),
('S0014','Music Producer',50.00),
('S0015','Project manager',98.50),
('S0016','Software Enginneer',50.00),
('S0017','IT Technician',40.50),
('S0018','Server Adminstrator',62.00),
('S0019','Network Enginneer',125.00);
-- --------------------------------------------------------
--
----Dumping data for table `employee_skill`
--
INSERT INTO `employee_skill`(`Skill_ID`,`Wrk_ID`) VALUES
('S0010','W0010'),
('S0011','W0011'),
('S0012','W0012'),
('S0013','W0013'),
('S0014','W0014'),
('S0015','W0015'),
('S0016','W0016'),
('S0017','W0017'),
('S0018','W0018'),
('S0019','W0019');
最佳答案
1)您的第一个查询需要连接条件,例如
where worker.wrkid= skill.wrkid and ....
2)您的第二个查询有错误,您需要在分配和工作人员之间使用逗号。还需要加入条件。
关于mysql - 在 mysql 数据查询上获取不需要的输出 mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30284461/
我有三张 table 。表 A 有选项名称(即颜色、尺寸)。表 B 有选项值名称(即蓝色、红色、黑色等)。表C通过将选项名称id和选项名称值id放在一起来建立关系。 我的查询需要显示值和选项的名称,而
在mysql中,如何计算一行中的非空单元格?我只想计算某些列之间的单元格,比如第 3-10 列之间的单元格。不是所有的列...同样,仅在该行中。 最佳答案 如果你想这样做,只能在 sql 中使用名称而
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭 7 年前。 Improve this ques
我正在为版本7.6进行Elasticsearch查询 我的查询是这样的: { "query": { "bool": { "should": [ {
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭 7 年前。 Improve this ques
是否可以编写一个查询来检查任一子查询(而不是一个子查询)是否正确? SELECT * FROM employees e WHERE NOT EXISTS (
我找到了很多关于我的问题的答案,但问题没有解决 我有表格,有数据,例如: Data 1 Data 2 Data 3
以下查询返回错误: 查询: SELECT Id, FirstName, LastName, OwnerId, PersonEmail FROM Account WHERE lower(PersonEm
以下查询返回错误: 查询: SELECT Id, FirstName, LastName, OwnerId, PersonEmail FROM Account WHERE lower(PersonEm
我从 EditText 中获取了 String 值。以及提交查询的按钮。 String sql=editQuery.getText().toString();// SELECT * FROM empl
我有一个或多或少有效的查询(关于结果),但处理大约需要 45 秒。这对于在 GUI 中呈现数据来说肯定太长了。 所以我的需求是找到一个更快/更高效的查询(几毫秒左右会很好)我的数据表大约有 3000
这是我第一次使用 Stack Overflow,所以我希望我以正确的方式提出这个问题。 我有 2 个 SQL 查询,我正在尝试比较和识别缺失值,尽管我无法将 NULL 字段添加到第二个查询中以识别缺失
什么是动态 SQL 查询?何时需要使用动态 SQL 查询?我使用的是 SQL Server 2005。 最佳答案 这里有几篇文章: Introduction to Dynamic SQL Dynami
include "mysql.php"; $query= "SELECT ID,name,displayname,established,summary,searchlink,im
我有一个查询要“转换”为 mysql。这是查询: select top 5 * from (select id, firstName, lastName, sum(fileSize) as To
通过我的研究,我发现至少从 EF 4.1 开始,EF 查询上的 .ToString() 方法将返回要运行的 SQL。事实上,这对我来说非常有用,使用 Entity Framework 5 和 6。 但
我在构造查询来执行以下操作时遇到问题: 按activity_type_id过滤联系人,仅显示最近事件具有所需activity_type_id或为NULL(无事件)的联系人 表格结构如下: 一个联系人可
如何让我输入数据库的信息在输入数据 5 分钟后自行更新? 假设我有一张 table : +--+--+-----+ |id|ip|count| +--+--+-----+ |
我正在尝试搜索正好是 4 位数字的 ID,我知道我需要使用 LENGTH() 字符串函数,但找不到如何使用它的示例。我正在尝试以下(和其他变体)但它们不起作用。 SELECT max(car_id)
我有一个在 mysql 上运行良好的 sql 查询(查询 + 连接): select sum(pa.price) from user u , purchase pu , pack pa where (
我是一名优秀的程序员,十分优秀!