diff --git a/core/lib/Drupal/Core/Database/Query/Select.php b/core/lib/Drupal/Core/Database/Query/Select.php
index 3c687da..0d486a5 100644
--- a/core/lib/Drupal/Core/Database/Query/Select.php
+++ b/core/lib/Drupal/Core/Database/Query/Select.php
@@ -572,6 +572,19 @@ public function execute() {
   /**
    * {@inheritdoc}
    */
+  public function executeTemporary() {
+    // If validation fails, simply return NULL.
+    // Note that validation routines in preExecute() may throw exceptions instead.
+    if (!$this->preExecute()) {
+      return NULL;
+    }
+
+    $args = $this->getArguments();
+    return $this->connection->queryTemporary((string) $this, $args, $this->queryOptions);
+  }
+  /**
+   * {@inheritdoc}
+   */
   public function distinct($distinct = TRUE) {
     $this->distinct = $distinct;
     return $this;
diff --git a/core/lib/Drupal/Core/Database/Query/SelectInterface.php b/core/lib/Drupal/Core/Database/Query/SelectInterface.php
index b784610..2847fe3 100644
--- a/core/lib/Drupal/Core/Database/Query/SelectInterface.php
+++ b/core/lib/Drupal/Core/Database/Query/SelectInterface.php
@@ -489,6 +489,14 @@ public function preExecute(SelectInterface $query = NULL);
   public function execute();
 
   /**
+   * Executes a SELECT query string and saves the result set to a temporary table.
+   *
+   * @return string
+   *   The name of the temporary table.
+   */
+  public function executeTemporary();
+
+  /**
    * Helper function to build most common HAVING conditional clauses.
    *
    * This method can take a variable number of parameters. If called with two
diff --git a/core/modules/system/src/Tests/Database/SelectTest.php b/core/modules/system/src/Tests/Database/SelectTest.php
index 26dd109..b3df925 100644
--- a/core/modules/system/src/Tests/Database/SelectTest.php
+++ b/core/modules/system/src/Tests/Database/SelectTest.php
@@ -494,4 +494,22 @@ function testEmptyInCondition() {
     }
   }
 
+  /**
+   * Tests Select::executeTemporary().
+   */
+  function testExecuteTemporary() {
+    $query = db_select('test');
+    $query->addField('test', 'name');
+    $query->addField('test', 'age', 'age');
+    $temporary_table = $query->executeTemporary();
+    $this->assertTrue($temporary_table, 'Temporary table name returned.');
+
+    $query = db_select($temporary_table);
+    $query->addField($temporary_table, 'name');
+    $query->addField($temporary_table, 'age');
+
+    $num_records = $query->countQuery()->execute()->fetchField();
+    $this->assertEqual($num_records, 4, 'Returned the correct number of rows.');
+  }
+
 }
