This is a discussion on Check whether two strs have at least one shared character. within the Pgsql General forums, part of the PostgreSQL category; --> Hello, Is there a simple way/command/function to check whether two strings have at least one overlap character please? For ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello, Is there a simple way/command/function to check whether two strings have at least one overlap character please? For example, str1: 05baaa str2: ooboo Query: select str1 ??? str2 ; Result: true Because b is in both str1 and str2. Thank you! ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match |
| ||||
| Emi Lu wrote: > Is there a simple way/command/function to check whether two > strings have at least one overlap character please? > > For example, > > str1: 05baaa > str2: ooboo > > Query: select str1 ??? str2 ; > > Result: true > > Because b is in both str1 and str2. SELECT str1 ~ ( '[' || str2 || ']'); See http://www.postgresql.org/docs/curre...tching.html#FU NCTIONS-POSIX-REGEXP Yours, Laurenz Albe ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend |