A dozen table, inside have date of these two fields: "DUIZHANGRQ" medical institution code: "YILIAOJGDM," Now in order to query the same day, all the data of the same type of medical institutions, how to do it, I use the full join found out there are repeated, not to heavy, , the back of the field are some statistics, how to combine all institutions and date the same data, such as DUIZHANGRQ for 3100200310153, YILIAOJGDM for 2018/7/9 Show all the data in one line, and the corresponding data fields together, such as into the row shows and 84 of them
CodePudding user response:
The group aggregation can not? The select yiliaojgdm duizhangrq, sum (hisnum) From the table Group by yiliaojgdm duizhangrq