select a.orderid,a.AnalysisContent,a.SourceContent from ticketprintout_20211221 a right join (
SELECT orderid,max(PrintOutTime) as maxtime from ticketprintout_20211221 GROUP BY orderid having count(OrderId)>1
) b on a.orderid=b.OrderId and a.PrintOutTime=b.maxtime
orderid字段为重复依据,PrintOutTime字段为大小依据