描述下面的SQL查询的输出:SQL语法新手学生
select custId, name
from customer
where region = "New York"
UNION
select cust.custId, cust.name
from customer cust
where cust.custId IN (select cust_order.custId
from customer_order cust_order, company_employee comp_emp
where cust_order.salesEmpId = comp_emp.empId
AND comp_emp.name = 'DANIEL');
我的问题是:在包含from customer cust
是“卡斯特”指的是列在客户表中的行?
这是一个家庭作业的问题,我已经确定导致这一行 成分,我认为这是卡斯特在客户表中的列... 我不问了一个整体的解决方案,如果只是一点点鼓励我在正确的轨道上...
嗯,这看起来像一个声明,选择所有客户的居住在纽约的身份证和名称,加上丹尼尔进行销售的所有客户...因为没有指定'UNION ALL',所以没有重复。 – 2010-04-23 18:14:15