次のビューを作成しようとしていますが、次のエラーが表示されます: 1 つのカウント ステートメントを実行できます (AS "Mod0" を削除した場合) 新しい列への出力カウントを使用して、複数の部分文字列をカウントすることは可能ですか?
create view portcnt as
select
address,
datacenter,
ifdesc,
count(substring(ifdesc, 'Ethernet0/*')) as "Mod0",
count(substring(ifdesc, 'Ethernet1/*')) as "Mod1",
count(substring(ifdesc, 'Ethernet2/*')) as "Mod2",
count(substring(ifdesc, 'Ethernet3/*')) as "Mod3",
count(substring(ifdesc, 'Ethernet4/*')) as "Mod4",
count(substring(ifdesc, 'Ethernet5/*')) as "Mod5",
count(substring(ifdesc, 'Ethernet6/*')) as "Mod6"
over (partition by address)
from ifstatus where datacenter = 'DC'
and ifadminstatus = '1' and ifoperstatus = '1';
ERROR: syntax error at or near "by"
LINE 13: over (partition by address)