Remix.run Logo
chongli 16 hours ago

When working with larger enterprise software, it is common to have large CASE WHEN statements translating application status codes into plain English. For example, status code 1 could mean the item is out of stock.

Why wouldn’t you store this information in a table and query it when you need it? What if you need to support other languages? With a table you can just add more columns for more languages!

megaman821 15 hours ago | parent [-]

I usually use generated columns for this. It still uses CASE WHEN but it is obvious to all consumers of the table that it exists.