ALTER TABLE `contacts` CHANGE `custom_var6` `custom_var6` VARCHAR( 15 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ; ALTER TABLE `alc_test`.`contacts` ADD INDEX ( `custom_var6` ) ; -- 2014-04-01 gakunen updates SELECT id, last_name, date_modified, grade, grade_entrance_date, grade_entered, date_modified, date_entered, contact_status FROM contacts WHERE smsgroup='student' AND grade IN ("00", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17") UPDATE contacts SET grade="general" WHERE smsgroup='student' AND grade ="17" UPDATE contacts SET grade=grade+1 WHERE smsgroup='student' AND grade IN ("00", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16")