Forum Discussion
How to create a matrix with values that are less than or equal to the column value
that seems like a straightforward crossjoin. What have you tried and where are you stuck?
- VimWan3 years agoFrequent Visitor
Thanks Ibendin,
I understand that a crossjoin mashes all the rows from both table together, is there a way for us to specify that we want to mash specific records from the student enrollment data to every consecutive date record where the add date of the student enrollment table record must be less than or equal to the report date?
- VimWan3 years agoFrequent Visitor
Right now from your suggestion, I'm thinking I can crossjoin all rows from both tables and then remove any rows where the Add Date > Report Date after the join. Since this seems inefficient, any suggestions to improve this?
Another point I wanted to make is that if my student enrollment table is a table with a large number of rows, wouldn't using a cross join potentially cause performance issues?
- lbendlin3 years ago
Super User
Since this seems inefficientall database engines are optimized for handling cartesian products. They have to do that anyway, for every single join. you can help by reducing cardinality soon in the process.