SELECT * FROM `table1` INNER JOIN `table2` WHERE `table1`.`date`=CURDATE()
RANK() over(partition by table2.id order by table1.id) as RNK
select * from
(
SELECT *, RANK() over(partition by table2.id order by table1.id) as RNK
FROM `table1` INNER JOIN `table2` WHERE `table1`.`date`=CURDATE()
) X where X.rnk=1