SQL: Join tables on substrings

前端 未结 5 759
北海茫月
北海茫月 2020-12-11 05:56

I have a table A with the string-column a and a table B with the string-column b. a is a substring of b.

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-11 06:45

    set an inner join on a substring(4 letters) of FIELD1 of table TABLE1 with FIELD1 of table TABLE2

    select TABLE1.field1,TABLE2.field1 from TABLE1 inner join TABLE2 on substring(TABLE1.field1,2,5)=TABLE2.field1
    

提交回复
热议问题