If there is no identifier column in the base table, you can create it with pseudo-columns.
In SQL server: SELECT ROW_NUMBER () OVER (ORDER by FiscalYear, FiscalMonth), FiscalYear, FiscalMonth, ... FROM ... See http://msdn.microsoft.com/en-us/library/ms186734.aspx
In Oracle: SELECT ROWNUM, FiscalYear, FiscalMonth, ... FROM .... In oracle, ROWNUM uses order in the result set.
source
share