【问题标题】:Unsupported use of with clause不支持使用 with 子句
【发布时间】:2020-04-04 17:29:17
【问题描述】:
create view Captain_Aragna as (with noCommentedProp as (
   select member as nick, title, director, club
   from Proposals
   minus (
       select nick, title, director, club
       from Comments
   )
), noCommentedNicksWCants as (
   select nick, count(nick) as noCommentedCant
   from noCommentedProp
   group by nick
), usersProposalsWCants as (
   select member as nick, count(member) as proposalsCant
   from Proposals
   group by member
), finalJoin as (
   select *
   from noCommentedNicksWCants
   join usersProposalsWCants
   using (nick)
)select nick, noCommentedCant/proposalsCant*100 as Porcentaje
from finalJoin);

有人可以帮我解决这个错误吗,我知道如何创建一个视图并在里面制作一个,当我用视图制作这个时,它会选择 clumns

【问题讨论】:

    标签: sql oracle common-table-expression sqlplus sql-view


    【解决方案1】:

    我认为以下语法可以工作:

    create view Captain_Aragna as 
    with 
        noCommentedProp as (
           select member as nick, title, director, club
           from Proposals
           minus (
               select nick, title, director, club
               from Comments
           )
        ), 
        noCommentedNicksWCants as (
           select nick, count(nick) as noCommentedCant
           from noCommentedProp
           group by nick
        ), 
        usersProposalsWCants as (
           select member as nick, count(member) as proposalsCant
           from Proposals
           group by member
        ), 
        finalJoin as (
           select *
           from noCommentedNicksWCants
           join usersProposalsWCants
           using (nick)
        )
    select nick, noCommentedCant/proposalsCant*100 as Porcentaje
    from finalJoin
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-24
      • 2019-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-26
      相关资源
      最近更新 更多