简体   繁体   English

如何从Oracle SQL Developer中的VIEW中删除多个列

[英]How do I drop multiple columns from a VIEW in Oracle SQL developer for good

So the script that I have used for creating the view is as follows: 因此,我用于创建视图的脚本如下:

create view Grantson_Samples as  
(  
  select *  
  from MEASUREMENT  
  inner join SCIENTIST using (Scientist_Num)  
  inner join SITE using (Site_ID)  
  inner join MEASUREMENT_TYPE using (Name)  
  where SCIENTIST_NUM = '31415'  
  );  

Don't worry about the stuff in caps (those are other tables). 不用担心大写字母(其他表格)中的内容。 The problem however is that the view generated has all these extra columns that I don't want. 但是,问题在于生成的视图具有我不想要的所有这些额外的列。 How do I drop those? 我该如何丢弃那些? Essentially everything in the red box needs to go. 基本上,红色框中的所有内容都需要删除。

Thanks and apologies in advance for any mistakes made. 如有任何错误,请先感谢和道歉。 Rookie SQL learner here. 新手SQL学习者在这里。

视图的屏幕截图。

This is all in Oracle SQL Developer. 这一切都在Oracle SQL Developer中。

Decide on what columns you want to keep. 确定要保留的列。 Then: 然后:

create or replace view Grantson_Samples as
    select col1, col2, . . .
    from MEASUREMENT inner join
         SCIENTIST
         using (Scientist_Num) inner join
         SITE
         using (Site_ID) inner join
         MEASUREMENT_TYPE
         using (Name)
    where SCIENTIST_NUM = '31415';

Basically, this recreates the view with the columns that you want. 基本上,这将使用所需的列重新创建视图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM