The product name contains words separated by a space. The first word is the second place in the brand, etc.
How to extract these words from a string, eq, how to implement a query like:
select id, getwordnum( prodname,1 ) as size, getwordnum( prodname,2 ) as brand from products where ({0} is null or getwordnum( prodname,1 )={0} ) and ({1} is null or getwordnum( prodname,2 )={1} ) create table product ( id char(20) primary key, prodname char(100) );
How to create the getwordnum () function in Postgres or use some substring () or another function used directly in this request to improve speed?
source share