|
|||||||||||
|
AW: Delete query question
From: <it(at)hertlein-online.com>
Date: Wed Sep 05 2007 - 09:52:03 EDT
Hey all I am stuck here (thinking wise) and need some ideas: I have this table:
CREATE TABLE `geno_260k` (
CONSTRAINT `geno_260k_ibfk_2` FOREIGN KEY (`marker_id`) REFERENCES `markers` (`marker_id`), CONSTRAINT `geno_260k_ibfk_1` FOREIGN KEY (`ident`) REFERENCES`individual` (`ident`) ) ENGINE=InnoDB AUTO_INCREMENT=91318273 DEFAULT CHARSET=utf8 And with the following query I get 159 ident's back: select ident from geno_260k where a1=0 group by ident having count(a1)>250000;
I want to delete all records containing those idents (about 260000 per ident
so 159*260000).
delete from geno_260k where ident=(select ident from geno_260k where a1=0 group by ident having count(a1)>250000); But mysql can not select and delete from the same table. Any ideas?
Thanks
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=lists@pantek.comReceived on Wed Sep 5 09:54:25 2007 This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 10:08:55 EDT |
||||||||||
|
|||||||||||