This time, we could possibly be joining to one or many rows of otherTable, because we're joining on myTable's primary key. Zero, one, or many rows of otherTable may have the same value.
I have no idea what to call this convenience function yet, though.
innerJoinUsingSourcePrimaryKey()?
innerJoinUsingPrimaryKeyManyRows()?
innerJoinUsingPrimaryKey2()?
innerJoinUsingPrimaryKeyReverse()?
No clue.
leftJoin and candidateKey joins should also have this "reverse" function.
Without these functions, we have to go back to using tsql.eqPrimaryKeyOfTable().
However, it may not be so bad. In my personal experience, it is not often that I want to do the reverse. And if I do, it usually indicates suspcious code.
However, my personal experience may not be the same as everyone else's experience...
innerJoinUsingPrimaryKey()
is a convenience function for,Using
innerJoinUsingPrimaryKey()
, you know that you are joining to a single row ofotherTable
. Because you're joining onotherTable
's primary key.It may be useful to have a function that goes the other way around,
This time, we could possibly be joining to one or many rows of
otherTable
, because we're joining onmyTable
's primary key. Zero, one, or many rows ofotherTable
may have the same value.I have no idea what to call this convenience function yet, though.
innerJoinUsingSourcePrimaryKey()
?innerJoinUsingPrimaryKeyManyRows()
?innerJoinUsingPrimaryKey2()
?innerJoinUsingPrimaryKeyReverse()
?No clue.
leftJoin and candidateKey joins should also have this "reverse" function.
Without these functions, we have to go back to using
tsql.eqPrimaryKeyOfTable()
. However, it may not be so bad. In my personal experience, it is not often that I want to do the reverse. And if I do, it usually indicates suspcious code.However, my personal experience may not be the same as everyone else's experience...