Total odd numbers in the table:

SQL

SELECT SUM((nr1 & 1) + (nr2 & 1) + (nr3 & 1) + (nr4 & 1) + (nr5 & 1) + (nr6 & 1)) FROM YourTable ;Total even numbers in the table:

SQL

SELECT SUM((1 - nr1 & 1) + (1 - nr2 & 1) + (1 - nr3 & 1) + (1 - nr4 & 1) + (1 - nr5 & 1) + (1 - nr6 & 1)) FROM YourTable ;Rows containing six even numbers:

SQL

SELECT Count(1) FROM YourTable WHERE nr1 & 1 = 0 And nr2 & 1 = 0 And ...Rows containing six odd numbers:

SQL

SELECT Count(1) FROM YourTable WHERE nr1 & 1 = 1 And nr2 & 1 = 1 And ...

Now the slightly more complicated queries:

5 even and 1 odd:

SQL

SELECT Count(1) FROM YourTable WHERE (nr1 & 1) + (nr2 & 1) + (nr3 & 1) + (nr4 & 1) + (nr5 & 1) + (nr6 & 1) = 1 ;You should be able to work out the others from there. :)