當前位置:商標查詢大全網 - 彩票開獎 - 做了個彩票管理系統,用SQL語言怎麽查詢 出開獎號碼完全相同那幾期,列名有:開獎期號,

做了個彩票管理系統,用SQL語言怎麽查詢 出開獎號碼完全相同那幾期,列名有:開獎期號,

用嵌套查詢:

select A.* From CAIPIAO A inner join

(select RNumber1,RNumber2,RNumber3,RNumber4,RNumber5,RNumber6,BNumber From CAIPIAO

group by RBNumber1,RNumber2,RNumber3,RNumber4,RNumber5,RNumber6,BNumber

having COUNT(ID)>1) B on A.RNumber1=B.RNumber1 and A.RNumber2=B.RNumber2

and A.RNumber3=B.RNumber3

and A.RNumber4=B.RNumber4

and A.RNumber5=B.RNumber5

and A.RNumber6=B.RNumber6

and A.BNumber=B.BNumber