Home > database > Like a piece of table, without a primary key, how to use SQL statements into the second table
Like a piece of table, without a primary key, how to use SQL statements into the second table
Time:09-27
In SQL statement execution how to write, table named t1
CodePudding user response:
Only know that this model is simple but can't be used,,,
CodePudding user response:
The month= Row_number () over (parti by year order by year)
CodePudding user response:
SELECT * FROM (SELECT YEAR, MONTH, COUNT the FROM t1 ORDER BY YEAR, MONTH) t WHERE ROWNUM<=9 The MODEL DIMENSION BY (YEAR, MONTH) MEASURES (COUNT) RULES (COUNT (2003, 2]=COUNT 2002, 2 + 1, COUNT=COUNT [2003] [2002] + 1, The COUNT (2003, 4]=COUNT [2002] + 1) The ORDER BY YEAR and the MONTH
CodePudding user response:
No hint this error, how to deal with
CodePudding user response:
Select year, row_number () over (partition by year order by year) the month and year - 2000 + row_number () over (partition by year order by year) * 0.1 from t1