Now can only do it shows each user's all reception,
SELECT distinct table_yonghu idtable_yonghu, table_yonghu yonghuID, table_yonghu. Yonghu_name,
Table_reception. Riqi
The FROM table_reception, table_yonghu
Where table_yonghu. YonghuID=table_reception. YonghuID
And table_yonghu. Isdeleted=0 and table_reception. Riqi & gt; '2018-4-10' and table_reception. Riqi & lt;
'2018-4-11' and table_reception. Dianhao='0218' and table_reception. Jinshouren='manager'
The order by table_reception. Idtable_reception desc
CodePudding user response:
select distinct b.i dtable_yonghu, b.y onghuID, b.y onghu_name,
(select Max (a.r iqi) from table_reception where a a.y onghuID=b.y onghuID and a.r iqi & gt; '2018-4-10' and a.r iqi & lt; '2018-4-11' and a. d. ianhao='0218' and a. inshouren='manager') as jiedai
The from table_yonghu b
Where isdeleted=0 order by jiedai desc