

(Vote for please, I'm just illustrating how to clearly explain - I hope - what you want to achieve, sample data, etc). WHERE string_a LIKE ANY (SELECT '%'||candidate_str||'%' FROM tableB) If so, shamelessly stealing excellent suggestion, you would use: SELECT string_a If the position is greater than the number of parts after splitting, the SPLITPART () function returns an empty string. 3) position is the position of the part to return, starting from 1. bork doesn't match any substring so it is not found. 2) delimiter The delimiter is a string used as the delimiter for splitting. There is no need to show the substring(s) that matched.
POSTGRESQL STRING CONTAINS SUBSTRING MANUAL
I want the result set: the manual is greatīecause the manual is great has man and great in it and because chicken chicken chicken has chicken in it. ('the manual is great'), ('Chicken chicken chicken'), ('bork') postgresql - Split a string at a specific character in SQL - Stack Overflow Split a string at a specific character in SQL Ask Question Asked 8 years, 1 month ago Modified 1 month ago Viewed 50k times 21 In my SQL statement I have to extract a substring from a string at the character.

Given: CREATE TABLE tableA (string_a text) Sn is a substring of Sa.Ī simple example to show what I mean (hint, hint):

Sn from table B to find out if any of the other strings in S1. Some of them are used internally to implement the SQL -standard string functions listed in Table 9.8. In PostgreSQL, the substring function is used to extract a substring from a string. I'm going to take a wild stab in the dark and assume you mean that you want to match a string Sa from table A against one or more other strings S1. SQL String Functions and Operators Additional string manipulation functions are available and are listed in Table 9.9. How to find substring using results of subquery?ĬONSTRAINT uchastki_pkey PRIMARY KEY (fid),ĬONSTRAINT enforce_dims_the_geom CHECK (st_ndims(the_geom) = 2) I have a table and i want to find a string in one row (character varying datatype) of this table using substring (character varying datatype) returned by subquery: SELECT uchastki.kadnumīut get a error ERROR: more than one row returned by a subquery used as an expression
