INDEX BY clause
To create an index for a temporary table, specify the INDEX BY keyword in the query and list the fields to be used to build the index. Example:
SELECT
Code,
Description
INTO TemporaryTable
FROM Catalog.Items
INDEX BY Code
Fields used for indexing must be included in the selection list.
You can use logical
expressions in the clause.