一个交易和其他客户有两个表。我获得了多行customerid
和服务时间,但我想要客户名称(在客户表中)和服务时间。所以我尝试了下面的查询,这是无效的。
select name,service_time from CUSTOMER,TRANSACTION
WHERE id IN
(
select customer_id,service_time from TRANSACTION
where service_date='$date' and employee_id='$employee_id'
);
答案 0 :(得分:0)
使用SELECT c.name, t.service_time
FROM CUSTOMER AS c
JOIN TRANSACTION AS t ON t.customer_id = c.id
WHERE t.service_date = '$date'
AND employee_id = '$employee_id'
yum install ./ABCpython34u-3.4.3-2.ius.el6.x86_64.rpm ./ABCpython34u-libs-3.4.3-2.ius.el6.x86_64.rpm
请参阅: