Skip to content

Instantly share code, notes, and snippets.

@ian29
Created January 25, 2012 05:53
Show Gist options
  • Save ian29/1674989 to your computer and use it in GitHub Desktop.
Save ian29/1674989 to your computer and use it in GitHub Desktop.
chg sch
alter table clean_sch add column chg_math04_0910;
alter table clean_sch add column chg_math08_0910;
alter table clean_sch add column chg_math10_0910;
alter table clean_sch add column chg_math12_0910;
alter table clean_sch add column chg_read04_0910;
alter table clean_sch add column chg_read08_0910;
alter table clean_sch add column chg_read10_0910;
alter table clean_sch add column chg_read12_0910;
update clean_sch set chg_math04_0910 = 'up' where (all_math04_0910 > all_math04_0809);
update clean_sch set chg_math08_0910 = 'up' where (all_math04_0910 > all_math04_0809);
update clean_sch set chg_math10_0910 = 'up' where (all_math04_0910 > all_math04_0809);
update clean_sch set chg_math12_0910 = 'up' where (all_math04_0910 > all_math04_0809);
update clean_sch set chg_read04_0910 = 'up' where (all_read04_0910 > all_read04_0809);
update clean_sch set chg_read08_0910 = 'up' where (all_read08_0910 > all_read08_0809);
update clean_sch set chg_read10_0910 = 'up' where (all_read10_0910 > all_read10_0809);
update clean_sch set chg_read12_0910 = 'up' where (all_read12_0910 > all_read12_0809);
update clean_sch set chg_math04_0910 = 'down' where (all_math04_0910 < all_math04_0809);
update clean_sch set chg_math08_0910 = 'down' where (all_math04_0910 < all_math04_0809);
update clean_sch set chg_math10_0910 = 'down' where (all_math04_0910 < all_math04_0809);
update clean_sch set chg_math12_0910 = 'down' where (all_math04_0910 < all_math04_0809);
update clean_sch set chg_read04_0910 = 'down' where (all_read04_0910 < all_read04_0809);
update clean_sch set chg_read08_0910 = 'down' where (all_read08_0910 < all_read08_0809);
update clean_sch set chg_read10_0910 = 'down' where (all_read10_0910 < all_read10_0809);
update clean_sch set chg_read12_0910 = 'down' where (all_read12_0910 < all_read12_0809);
update clean_sch set chg_math04_0910 = 'same' where (all_math04_0910 = all_math04_0809);
update clean_sch set chg_math08_0910 = 'same' where (all_math04_0910 = all_math04_0809);
update clean_sch set chg_math10_0910 = 'same' where (all_math04_0910 = all_math04_0809);
update clean_sch set chg_math12_0910 = 'same' where (all_math04_0910 = all_math04_0809);
update clean_sch set chg_read04_0910 = 'same' where (all_read04_0910 = all_read04_0809);
update clean_sch set chg_read08_0910 = 'same' where (all_read08_0910 = all_read08_0809);
update clean_sch set chg_read10_0910 = 'same' where (all_read10_0910 = all_read10_0809);
update clean_sch set chg_read12_0910 = 'same' where (all_read12_0910 = all_read12_0809);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment