Hi All,
Two days ago I was asked this question in an interview for Data Analyst position. Could some one please let me know the correct answer for this?
Say there is a single table with three columns.
- 1st column with GeneId(primary key)
- 2nd column Flag1,
- 3rd column Flag2.
Flag1 and Flag2 columns can have values of 0 or 1. How do I write a single SQL query in which I get the count of GeneIds for different combinations of Flag1,Flag2 possible, i.e. Flag1 0, Flag2 1, Flag1 1, Flag2 0, ....& other combinations.
Thanks for your time,
Regards Sashi