SQLite Forum

Not understanding a subquery - Some guidance?
Do you mayhaps mean:

-- queries to set up tables r & t
drop table t;
drop table r;
create table r (ritm text);
create table t (task text, ritm text, ud date);
insert into r values ('r1'), ('r2'), ('r3');
insert into t values ('t1', 'r1', '2021-01-01'), ('t2', 'r1', '2021-01-02'), ('t3', 'r1', '2021-01-03');
insert into t values ('t4', 'r2', '2021-01-01');

with v (task, ritm, ud)
  as (
         select task, ritm, max(ud)
          from t
      group by ritm
   select *
     from r
left join v
       on r.ritm == v.ritm