I was trying to evaluate a regular expression in PostgreSQL in where clause.
I have a column with value like the example (1,2) below. When I write a query in where clause I am passing parameter values as either "a" or "a,b" or "b" then it should return only the rows that contain "a" or "a,b" or "b".
When I pass "a" then it should check the row value and evaluate the "AND" , "OR" conditions as well.
Example:1
((((a.b.city == "x" AND a.b.state == "y" AND a.b.country == "z")) OR
(dis(x.y.d1, x.y.d2, "47.6015", "-122.3304") <= 5))
AND ((p.q.test == "**a**") OR (p.q.test == "b")))
Example:2
((((a.b.city == "x" AND a.b.state == "y" AND a.b.country == "z")) OR
(dis(x.y.d1, x.y.d2, "123", "-456") <= 5)) AND ((p.q.test == "a,b")
Here is a sample query.
select * from testtable where column ='parameter'
Please suggest.