gpt4 book ai didi

sql - Postgres - 选择 CASE when & order by the same column probme

转载 作者:行者123 更新时间:2023-11-29 14:16:09 26 4
gpt4 key购买 nike

<分区>

我有以下 SQL,它给我 psycopg2.ProgrammingError: column "rownum"does not exist

SELECT *, (case when col1 = 'A' then
1
when col1 = 'B' then
2
else
3
end) as rownum
from table1
order by colb, rownum, colc

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