1 Select * from messages where conversarion_id in ( select X.id from ( Select cast(datetime as date), id, row_number() over (partition by cast(datetime as date),id order by datetime) as rn from conversations c ) X where X.rn = 1 )
For the second solution, have to change in where clause only , i.e. run =2
Yes thats correct
Обсуждают сегодня