SELECT MIN(PrimaryKey),SecondaryKey FROM Table ; >INTO CURSOR TEMP ; >GROUP BY 2Now, what if I need to extract the minimum value between the primary key and the secondary key. Because, on some results, it may be that the result includes a record which is having the secondary key higher than the primary key.