gpt4 book ai didi

sql - 如何在 Oracle 11g 中选择前五行或 'N' 行

转载 作者:行者123 更新时间:2023-12-03 05:04:04 26 4
gpt4 key购买 nike

select distinct ani_digit, ani_business_line from cta_tq_matrix_exp limit 5

我想从结果集中选择前五行。如果我使用上面的查询,则会出现语法错误。

最佳答案

在选择“前 5 个”之前,您需要使用 DISTINCT:

SELECT * FROM 
(SELECT DISTINCT ani_digit, ani_business_line FROM cta_tq_matrix_exp) A
WHERE rownum <= 5

关于sql - 如何在 Oracle 11g 中选择前五行或 'N' 行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20656521/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com