Here's an example query:
SELECT thing_id
FROM thing
WHERE thing_type IN (3, 7)
I would like to turn the 3 and 7 into human-readable names to help understand what the query is truly doing. Something like the following would be great:
SELECT thing_id
FROM thing
WHERE thing_type_id IN (OPENED, ONHOLD)
Knowing that OPENED and ONHOLD would have their actual values declared somewhere else.
I'm thinking there may also be a way to do this with a JOIN of a thing_type table.
Note that I'm stuck in an environment where I'm coding queries directly rather than using an abstraction framework.