Select multiple rows with the same value(s)

前端 未结 5 1095
被撕碎了的回忆
被撕碎了的回忆 2020-12-13 10:17

I have a table, sort of like this:

ID  |  Chromosome | Locus | Symbol | Dominance |
===============================================
1   |      10     |   2           


        
5条回答
  •  無奈伤痛
    2020-12-13 10:22

    The problem is GROUP BY - if you group results by Locus, you only get one result per locus.

    Try:

    SELECT * FROM Genes WHERE Locus = '3' AND Chromosome = '10';
    

    If you prefer using HAVING syntax, then GROUP BY id or something that is not repeating in the result set.

提交回复
热议问题