试图在 mysql 中编写将显示约会的约会时间、技工名字、技工名字、客户名字和顾客名字,但我的代码给了我错误的结果。我只想要最大和最小持续时间和相应的名称。所以2行
SELECT
Min(Appointment.Appointment_duration) AS MINOfAppointment_duration,
Max(Appointment.Appointment_duration) AS MAXOfAppointment_duration,
mechanic_Firstname, mechanic_lastname, customer_firstname, customer_lastname
FROM Appointment, mechanic, Customer
WHERE (mechanic.mechanic_ID=Appointment.mechanic_ID) AND (customer.customer_ID=Appointment.customer_ID);
约会表中的记录
Appointment_ID Appointment_DATE Appointment_Duration Mechanic_ID Customer_ID
12 08/01/2007 0:35:00 1 5684
13 01/01/2009 2:15:36 6 2534
14 06/12/2010 0:05:29 7 7423