Reputation: 21
SELECT * FROM pg_requisition WHERE brands = any(1, 2, 32)
This is my Query , where I have a record in my database as 31,2 but the above query doesnt show me the result .
Whereas if I check with the query as
SELECT * FROM pg_requisition WHERE brands = any(1, 31, 32)
it shows the result.
Can Any one help as how to match the data from the start to the end and if found must return the output
Upvotes: 0
Views: 78
Reputation: 4967
Try the In clause.
SELECT * FROM pg_requisition WHERE brands IN (1, 2, 32);
Edit
Whereas if I check with the query as
SELECT * FROM pg_requisition WHERE brands = any(1, 31, 32)
it shows the result.
I assume you're talking about your sql-developer-tools.
If the tools display all the results it means that your query is correct, but it probably means that the way you're receiving the data is incorrect in your code.
You're probably just fetching the first result, or non at all, even though you get the data back, you need to learn how to iterate through the results and parse the selected rows.
Upvotes: 1