且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

TSQL:连接列,但一列中的行具有多个值

更新时间:2022-02-27 22:11:21

尝试

    select tab2.*   -- whatever
      from t1 tab1
inner join t2 tab2 on ( ';'||tab2.col2||';' like '%;'||tab1.col1||';%' )
         ;

附加的;字符用于避免联接条件中的析取.

the extra affixed ; characters serve to avoid disjunctions in the join condition.