Select from any of multiple values from a Postgres field
postgresql
Solution
You are describing the functionality of the in clause.
`select * from word_weight where word in ('a', 'steeple', 'the');`
Problem
I've got a table that resembles the following: ``` WORD WEIGHT WORDTYPE a 0.3 common the 0.3 common gray 1.2 colors steeple 2 object ``` I need to pull the weights for several different words out of the database at once. I could do: ``` SELECT * FROM word_weight WHERE WORD = 'a' OR WORD = 'steeple' OR WORD='the'; ``` but it feels ugly and the code to generate the query is obnoxious. I'm hoping that there's a way I can do something like (pseudocode): ``` SELECT * FROM word_weight WHERE WORD = 'a','the'; ```