Postgresql – sqlmodel query with a subselect self join
Trying to do a self join on a model but am getting confused how to do so in sqlmodel ORM. Something equivalent to the use of following SQL in Postgresql. SELECT tt.id, ttp.parent_name, tt.name FROM target_table tt, (select DISTINCT bb.parent_id,…