Crosstab with a large or undefined number of categories
问题 My real problem has to do with recording which of a very large number of anti-virus products agree that a given sample is a member of a given anti-virus family. The database has millions of samples, with tens of anti-virus products voting on each sample. I want to ask a query like "For the malware containing the name 'XYZ' which sample had the most votes, and which vendors voted for it?" and get results like: "BadBadVirus" V1 V2 V3 V4 V5 V6 V7 Sample 1 - 4 votes 1 0 1 0 0 1 1 Sample 2 - 5