Home > Enterprise >  Filtering selecting column with like clause from unrelated another table - Postgresql?
Filtering selecting column with like clause from unrelated another table - Postgresql?

Time:02-02

I have two unrelated tables. They both have varchar columns. If all rows in the text column of table B are in the text column of table A, I want to filter it like "Full Text Search".

For example:

A column of rows:

1- ABCD

2- DBCA

3- ACBD

B column of rows:

1- BC

Expected output at the end of the query:

3- ACBD

It's nonsensical but just for explanation:

"select text from table1 where text ilike concat('%', select text from table2, '%')"

How do you think I can do this query in the most efficient way?

Thanks in advance

Best

CodePudding user response:

You can do this without like '

  •  Tags:  
  • Related