Home > database >  [urgent] WITH RECURSIVE! Iterative queries
[urgent] WITH RECURSIVE! Iterative queries

Time:12-06

O see the great god, why was not this section of the query results, has been in the query
WITH RECURSIVE temp_table (databasename, tableName, ColumnName, num) AS
(SELECT
DatabaseName,
Tablename,
ColumnName,
1
The FROM Indices
UNION ALL
The SELECT temp_table databasename,
Temp_table tableName,
Indices. ColumnName | | ', '| | temp_table, ColumnName,
Temp_table. Num + 1
The FROM temp_table
Indices,
WHERE
Indices. DatabaseName=temp_table. DatabaseName and
Indices. The tableName=temp_table. TableName
) sel * from temp_table
QUALIFY ROW_NUMBER () OVER (PARTITION BY databasename, tableName ORDER BY num desc)=1;
  • Related