filter and create relationships before loading data
I think this is a very basic question but I've been searching and not found an answer so I'm going to try.
We have two rather large tables that are connected by a 1:many relationship through a unique sequence number. I wrote a SQL query to select the filtered set of the parent table along with the related supporting records but that creates a single really large table with lots of duplicate data.
I'd rather build this as a model (parent table with a relation to the supporting table) but if I don't filter the supporting table based on the connection to the parent table, it's too large.
I know I can do this but I can't for the life of me figure out how.