1

i have a table that store mutiple values in column i need to find if the value exists then return entire row

Example : 963963963;35793579;741741

Query am using

select * from table where column like (%963%);

which return all the rows that have the value starts or ends with 963

i need only one row that match with 963

1 Answer 1

1

It is generally bad table design to store semicolon separated data this way. If you must continue with your current design, you may use the following query to find an exact match for 963:

SELECT *
FROM yourTable
WHERE ';' || col || ';' LIKE '%;963;%';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.