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
Add a comment
|
1 Answer
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.
2 Comments
silvester landu hunggu wali
hi thank's for your replay ..when i try that query i got ``` SQL Error [42703]: ERROR: column "bwi" does not exist¶ Position: 39```
GMB
@silvesterlanduhungguwali: there is no
bwi in this query. You would need to figure out what the correct column names are...