that is not a huge database (actually it's quite small).If I understand your problem, you could first build a query that takes in your 20 columns and outputs unique characters from each column then combines them to produce a unique set over the whole table. For example, say I have this table:create table foo(a char(5), b char(5), c char(5)-- find unique charactersselect substring(a,1,1) charsunionselect substring(a,2,1)unionselect substring(a,3,1)unionselect substring(a,4,1)unionselect substring(a,5,1)-- column bunion select substring(b,1,1) unionselect substring(b,2,1)unionselect substring(b,3,1)unionselect substring(b,4,1)unionselect substring(b,5,1)-- column cunion select substring(c,1,1) unionselect substring(c,2,1)unionselect substring(c,3,1)unionselect substring(c,4,1)unionselect substring(c,5,1)
this should produce a result set where column 'chars' are unique