0

enter image description here

i have table like above . i want to select the pengumuman field from table using one of element in array from office field . SELECT pengumuman from pengumuman_table where officee ... and i don't know what the next to get data from array with element BWI . how fix that query ? .thanks for your replay

1 Answer 1

2

If you want to search the array for a specific value, use any():

select pengumuman
from pengumuman_table
where $1 = any(office)

$1 is the parameter to the query, a literal string to search for in the text arrays.

Sign up to request clarification or add additional context in comments.

2 Comments

hi thank's for your replay ..when i try that query i got ``` SQL Error [42703]: ERROR: column "bwi" does not exist¶ Position: 39```
@silvesterlanduhungguwali: there is no bwi in this query. You would need to figure out what the correct column names are...

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.