• I've used all three methods, depending on the situation. I use packing bits most of the time when I need to "score" rows based on some criteria to determine a sort order, or ranking. This often takes the form of:

    update my_table

    set score = case when criteria_1 = <somevalue> then 2^15 else 0 end +

    case when criteria_2 = <anothervalue> then 2^14 else 0 end

    This works well for me when some criteria have a higher value, and so if one fact is true about a row, that causes it to score better than all rows that do not have that value set. Of course in this case, I generally don't need to pull the individual bits back out since I could instead just query the data, and I'm really just using the calculated field to sort the table.

    Matthew Galbraith