I have a table, sort of like this:
ID | Chromosome | Locus | Symbol | Dominance |
===============================================
1 | 10 | 2 | A | Full |
2 | 10 | 2 | a | Rec. |
3 | 10 | 3 | B | Full |
4 | 10 | 3 | b | Rec. |
I'd like to select all rows with the same locus and chromosome. For example, rows 3 and 4. There may be more than 2 at a time and they may not be in order.
I tried this:
SELECT *
FROM Genes
GROUP BY Locus
HAVING Locus='3' AND Chromosome='10'
But it always returns row 3, never row 4, even when repeated. I think I'm missing something obvious and simple, but I'm at a loss.
Can someone help?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…