Temp-tables can (and should) be created with indices if you plan to run queries against them.
This table has one index (index1) containing of one field (field1). This index is primary and unique (meaning not two records can have the same contents of field1).
DEFINE TEMP-TABLE ttTempTable NO-UNDO
FIELD field1 AS INTEGER
FIELD field2 AS CHARACTER
FIELD field3 AS LOGICAL
INDEX index1 IS PRIMARY UNIQUE field1 .