A small but important corner of a database that I'm designing will be used to store the result of arbitrary calculations. These results can be of any type. How can I represent a Value field that can be of any type in a relational database?
The only thing I can think of is to have separate tables based on data type that all have foreign keys back to a generic table. That doesn't seem right to me because in order to get the values back, I would have to join on a bunch of different tables. There must be a better way.