I have following table in postgres 10.
col1 col2 col3 col4
NCT00000102 Drug nifedipine nifed
NCT00000102 Drug nifedipine sulphate nifedipine
NCT00000103 Drug phospho nifedipine ni
NCT00000103 Drug phospho nifedipine sulphate phospho nifedipine
NCT00000105 Drug fluticasone furoate (veramyst®) nasal spray veramyst
NCT00000105 Drug fluticasone furoate (veramyst®) nasal spray vera
NCT00000106 Drug veramyst veramyst
I am looking for a way to filter above table so that either only exact match or partial match but with the complete word/s included.
I am expecting below output.
col1 col2 col3 col4
NCT00000102 Drug nifedipine sulphate nifedipine
NCT00000103 Drug phospho nifedipine sulphate phospho nifedipine
NCT00000105 Drug fluticasone furoate (veramyst®) nasal spray veramyst
NCT00000106 Drug veramyst veramyst
I tried using below query but it is not giving me the partial matches properly.
where col3 '%' || col4 || '%'
Any suggestion here will be really useful.
LIKE?