Hi, let supose that I have next columns in Mysql database q1a, q1b, q1c and Gender with next values (5 rows) q1a (1,3,5,7,9) q1b (1,2,3,4,5) q1c (1,6,7,8,9) Gender (1,1,2,2,1) which gives the table id q1a q1b q1c Gender 1 1 1 1 1 2 3 2 6 1 3 5 3 7 2 4 7 4 8 2 5 9 5 9 1 I would like to make a single query wich will return me how many (count?) 1,2,3,4,5,6,7,8,9 from all thre variables (q1a, q1b and q1c) are in Gender 1 or 2. I'd like to have table with count to look something like this: q1a OR q1b OR q1c=1 AND Gender=1 ----> count is 3, which means that code 1 show up in column q1a,q1b,q1c 3 times when Gender is 3 q1a OR q1b OR q1c=1 AND Gender=2 ----> count is 0 q1a OR q1b OR q1c=2 AND Gender=1 ----> count is 1 q1a OR q1b OR q1c=2 AND Gender=2 ----> count is 0 q1a OR q1b OR q1c=3 AND Gender=1 ----> count is 1 q1a OR q1b OR q1c=3 AND Gender=2 ----> count is 1 etc... please help, thank you Borut