Select multiple rows with the same value(s)

前端 未结 5 1099
被撕碎了的回忆
被撕碎了的回忆 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:21

    This may work for you:

    select t1.*
    from table t1
    join (select t2.Chromosome, t2.Locus
        from table2
        group by t2.Chromosome, t2.Locus
        having count(*) > 1) u on u.Chromosome = t1.Chromosome and u.Locus = t1.Locus
    

提交回复
热议问题