How to preserve the order of the fields to be selected when using $query->addExpression()
问题 I'm using Drupal 7 and I have to make a union on multiple tables. For the union to work some conditions have to be met: same number of columns same data type same order Some of the tables are missing a column so in order to compensate for that I just add it with something like this: $query->addExpression(':field_1', 'field_1', array(':field_1' => NULL)); . So at this point condition 1 & 2 are satisfied, but the order of the fields in the select is different. See example bellow: $query_1 = db