diff --git a/entityreference.install b/entityreference.install
index 57f85a6..620c927 100644
--- a/entityreference.install
+++ b/entityreference.install
@@ -172,9 +172,11 @@ function entityreference_update_7100() {
     $tx_schema = drupal_get_schema('taxonomy_index');
     db_create_table('taxonomy_index_tmp', $tx_schema);
     $select = db_select('taxonomy_index', 'tx');
-    $select->fields('tx');
+    $select->fields('tx', array('nid', 'tid'));
     $select->groupBy('tx.nid');
     $select->groupBy('tx.tid');
+    $select->addExpression('MAX(sticky)', 'sticky');
+    $select->addExpression('MAX(created)', 'created');
     db_insert('taxonomy_index_tmp')->from($select)->execute();
     db_drop_table('taxonomy_index');
     db_rename_table('taxonomy_index_tmp', 'taxonomy_index');
