postgresql - Search specific characters within a field in a table in postgres -



postgresql - Search specific characters within a field in a table in postgres -

i have number of fields have unordered info , ineed find records have pattern search. example:

field1 , field2 1 , "house, cars, people" 2 , "mazda, jefff, cat 15th stre" 3 , "do, money, arreaz, cars" . . n , "cars, postgres, json, abat"

as postgres search records have word "cars"

thanks can help

you should utilize regular expressions match particular illustration can following:

field2 ~ '^cars$' or field2 ~ ',cars,' or field2 ~ '^cars,' or field2 ~ ',cars$'

with regular expressions can search commas @ origin of string, @ end of string, origin of string, etc..

postgresql

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -