SELECt DISTINCT idFROM tableWHERe id NOT IN (SELECt id FROM table WHERe val = 'current')
或者:
SELECt a.idFROM table aLEFT JOIN table b ON a.id = b.id AND b.val = 'current'WHERe b.id IS NULL
欢迎分享,转载请注明来源:内存溢出
SELECt DISTINCT idFROM tableWHERe id NOT IN (SELECt id FROM table WHERe val = 'current')
或者:
SELECt a.idFROM table aLEFT JOIN table b ON a.id = b.id AND b.val = 'current'WHERe b.id IS NULL
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)