At work I had a challenging problem in the last days (in fact I like challenging problems and they’re not that rare which is why I like my job).
This time the problem was this:
- Let T be a table with columns C and X.
- Let the column E be of an enum type with a short, static defined values E1, E2, E3.
- Let the column X be a space separated list of tokens (values look like „ABC“, „ABC DEF“, „XUT OSH OJR“, with an arbitrary number of tokens).
- We look for the following information:
For a given token x in the values of X get a tuple R = (#(E1), #(E2), #(E3)), where #(Ei) denotes the number of rows in T, where x is included in X and the row has value Ei in column E.