how to use a like with a join in sql?

后端 未结 5 1253
无人及你
无人及你 2020-11-30 23:27

I have 2 tables, say table A and table B and I want to perform a join, but the matching condition has to be where a column from A \'is like\' a column from B meaning that an

5条回答
  •  北海茫月
    2020-11-30 23:57

    If this is something you'll need to do often...then you may want to denormalize the relationship between tables A and B.

    For example, on insert to table B, you could write zero or more entries to a juncion table mapping B to A based on partial mapping. Similarly, changes to either table could update this association.

    This all depends on how frequently tables A and B are modified. If they are fairly static, then taking a hit on INSERT is less painful then repeated hits on SELECT.

提交回复
热议问题