发布网友 发布时间:2022-04-26 21:37
共1个回答
热心网友 时间:2022-05-03 05:36
select t.authorid,t.author,COUNT(t.authorid) AS authornum from(select authorid,author,time from 表1union allselect authorid,author,time from 表2) twhere t.time > $time GROUP BY t.authorid,t.author ORDER BY authornum DESC基本就这样。表名你换成你自己的表名,我这里分别用表1和表2表示的追问select tp.ConsultationName,tp.DoctorName,tp.patientTime,tp.patientName from tb_patient tp where tp.ConsultationNum in( select OfficeId from tb_tv_Association_officeId where tv_ip='10.0.20.7' )and tp.State=1order BY tp.patientTime asc 这个是我写的 你那个我没看懂啊