
SELECT first_name, last_name FROM `contacts2` WHERE first_name>100000 AND first_name<100100

SELECT first_name, last_name FROM `contacts2` WHERE first_name>=100100 AND first_name<100200

SELECT first_name, last_name FROM `contacts2` WHERE first_name>=100200 AND first_name<100300

SELECT first_name, last_name FROM `contacts2` WHERE first_name>=100300 AND first_name<100400

SELECT first_name, last_name FROM `contacts2` WHERE first_name>=100400 AND first_name<100500

SELECT first_name, last_name FROM `contacts2` WHERE first_name>=100500 AND first_name<101000

SELECT first_name, last_name FROM `contacts2` WHERE first_name>=101000 AND first_name<102000

SELECT first_name, last_name FROM `contacts2` WHERE first_name>=102000 AND first_name<103000

UPDATE contacts2 SET last_name='hundred0' WHERE first_name>100000 AND first_name<100100 ; 
UPDATE contacts2 SET last_name='hundred1' WHERE first_name>=100100 AND first_name<100200 ; 
UPDATE contacts2 SET last_name='hundred2' WHERE first_name>=100200 AND first_name<100300 ; 
UPDATE contacts2 SET last_name='hundred3' WHERE first_name>=100300 AND first_name<100400 ; 
UPDATE contacts2 SET last_name='hundred4' WHERE first_name>=100400 AND first_name<100500 ; 
UPDATE contacts2 SET last_name='hundred5' WHERE first_name>=100500 AND first_name<101000 ; 
UPDATE contacts2 SET last_name='thousand1' WHERE first_name>=101000 AND first_name<102000 ; 
UPDATE contacts2 SET last_name='thousand2' WHERE first_name>=102000 AND first_name<103000 ; 
UPDATE contacts2 SET last_name='thousand3' WHERE first_name>=103000 AND first_name<104000 ; 
UPDATE contacts2 SET last_name='thousand4' WHERE first_name>=104000 AND first_name<105000 ; 
UPDATE contacts2 SET last_name='thousand5' WHERE first_name>=105000 AND first_name<106000 ; 
UPDATE contacts2 SET last_name='thousand6' WHERE first_name>=106000 AND first_name<107000 ; 
UPDATE contacts2 SET last_name='thousand7' WHERE first_name>=107000 AND first_name<108000 ; 
UPDATE contacts2 SET last_name='thousand8' WHERE first_name>=108000 AND first_name<109000 ; 
UPDATE contacts2 SET last_name='thousand9' WHERE first_name>=109000 AND first_name<110000 ; 
UPDATE contacts2 SET last_name='man1' WHERE first_name>=110000 AND first_name<120000 ; 
UPDATE contacts2 SET last_name='man2' WHERE first_name>=120000 AND first_name<130000 ; 
UPDATE contacts2 SET last_name='man3' WHERE first_name>=130000 AND first_name<140000 ; 
UPDATE contacts2 SET last_name='man4' WHERE first_name>=140000 AND first_name<150000 ; 
UPDATE contacts2 SET last_name='man5' WHERE first_name>=150000 AND first_name<160000 ; 
UPDATE contacts2 SET last_name='man6' WHERE first_name>=160000 AND first_name<170000 ; 
UPDATE contacts2 SET last_name='man7' WHERE first_name>=170000 AND first_name<180000 ; 
UPDATE contacts2 SET last_name='man8' WHERE first_name>=180000 AND first_name<190000 ; 
UPDATE contacts2 SET last_name='man9' WHERE first_name>=190000 AND first_name<200000 ; 

UPDATE contacts, contacts2 SET contacts.last_name=contacts2.last_name, contacts.first_name=contacts2.first_name WHERE contacts.id=contacts2.id ; 

SELECT * FROM  contacts WHERE last_name LIKE 'hundred0' ;

SELECT count(*) FROM contacts WHERE  custom_var20=1 

UPDATE contacts SET custom_var20=1 WHERE last_name LIKE 'hundred%' ;
UPDATE contacts SET custom_var20=1 WHERE last_name LIKE 'thousand%' ;

-- total 9,999 persons, large email template, with every run to send 800 persons on 2011/05/02 18:26 start
-- 800 emails are sent in about 2-2.5 minutes at each run

INSERT INTO `config` (`category`, `name`, `value`) VALUES ('massemailer', 'campaign_emails_per_run', '800');
