您是否可以使用 Matillion 数据库查询组件简单地运行 SQL 命令 - 类似于以下示例中的 SELECT ?
CREATE OR REPLACE TEMPORARY TABLE stacko_q
AS
SELECT 1 as id, 'jesse' as nm, 192 as amount UNION ALL
SELECT 2 as id, 'sam' as nm, 123 as amount UNION ALL
SELECT 3 as id, 'steve' as nm, 345 as amount UNION ALL
SELECT 4 as id, 'josh' as nm, 234 as amount UNION ALL
SELECT 5 as id, 'hamish' as nm, 452 as amount UNION ALL
SELECT 6 as id, 'john' as nm, 211 as amount UNION ALL
SELECT 7 as id, 'watson' as nm, 111 as amount UNION ALL
SELECT 8 as id, 'amir' as nm, 143 as amount UNION ALL
SELECT 9 as id, 'riaz' as nm, 311 as amount UNION ALL
SELECT 10 as id, 'panag' as nm, 139 as amount;
SELECT id, amount
FROM (
SELECT id,
amount,
rank() OVER (order by amount desc) my_rank
FROM stacko_q)
WHERE my_rank <= 3;
-- results - 3 rows
-- ID AMOUNT
-- 5 452
-- 3 345
-- 9 311
我希望这会有所帮助...丰富
ps 如果这个(或另一个)答案对您有帮助,请花点时间“接受”有帮助的答案,方法是单击答案旁边的复选标记,将其从“灰色”切换为“已填写”。