If I have a query that looks for a list of values in an Array column, is there a way to get the matched value as a computed column in result table?
Imagine the following query:
SELECT name, tags
FROM Books
WHERE Books.tags && ARRAY['APLLE', 'ORANGE']::varchar[]
This is what I intend to have as result:
| name | tags | query | <- I WANT query COLUMN
|---------|-------------------|----------|
| Cooking | {APPLE, EGGPLANT} | "APPLE" |
| Frying | {TOMATO, ORANGE} | "ORANGE" |
| Boiling | {APPLE} | "APPLE" |