Supprimer un message
cauet
- SELECT
- `envoi_push`.`content`,
- `confirm_push`.`status`
- FROM
- `envoi_push`
- JOIN
- ( SELECT *
- FROM `confirm_push`
- WHERE `confirm_push`.id IN (
- SELECT Max(id)
- FROM `confirm_push`
- GROUP BY `confirm_push`.`msgid`
- )
- ) AS `confirm_push`
- ON `envoi_push`.`status` = `confirm_push`.`msgid` LIMIT 10;
Ca j'avais encore jamais vu une requête mySQL qui fout phpmyadmin par terre (et une série de process Apache)
Structure de la table:
- CREATE TABLE IF NOT EXISTS `envoi_push` (
- `id` int(11) NOT NULL auto_increment,
- `nichandle` varchar(50) NOT NULL,
- `number` varchar(15) NOT NULL,
- `content` varchar(160) NOT NULL,
- `sendertype` varchar(10) NOT NULL,
- `senderid` varchar(15) NOT NULL,
- `typecontent` varchar(10) NOT NULL,
- `udh` varchar(500) NOT NULL,
- `status` int(10) NOT NULL,
- `error` varchar(10) NOT NULL,
- `date` datetime NOT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=130605 ;
- --
- -- Contenu de la table `envoi_push`
- --
- INSERT INTO `envoi_push` (`id`, `nichandle`, `number`, `content`, `sendertype`, `senderid`, `typecontent`, `udh`, `status`, `error`, `date`) VALUES
- (130602, 'mickael', '32472892611', 'hi', 'number', '3235559657', 'text', '', 3421301, '', '2007-12-21 07:45:09');
- CREATE TABLE IF NOT EXISTS `confirm_push` (
- `id` int(11) NOT NULL auto_increment,
- `msgid` int(11) NOT NULL,
- `status` varchar(35) NOT NULL,
- `date` datetime NOT NULL,
- KEY `msgid` (`msgid`),
- KEY `id` (`id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=235057 ;
- --
- -- Contenu de la table `confirm_push`
- --
- INSERT INTO `confirm_push` (`id`, `msgid`, `status`, `date`) VALUES
- (235051, 3421301, 'operator', '2007-12-21 07:45:28'),
- (235052, 3421301, 'handset', '2007-12-21 07:45:33');