I don’t know how to write a SQL statement, please ask for an expert - PHP Chinese website Q&A - I don’t know how to write a SQL statement, please ask for an expert - PHP Chinese website Q&A
SELECT a.编号,b.操作时间 ,b.操作人
FROM a
JOIN (SELECT b.*
FROM b
JOIN (SELECT b.编号,min(b.操作时间) '操作时间'
FROM b
GROUP BY b.编号)b1
ON b.编号 = b1.编号
AND b.操作时间 = b1.操作时间)b
ON a.操作编号 = b.操作编号
I don’t know how to write a SQL statement, please ask for an expert - PHP Chinese website Q&A - I don’t know how to write a SQL statement, please ask for an expert - PHP Chinese website Q&A
Just watch and learn.
上面回答写了c.操作人,实际上应该是b.操作人