简体   繁体   English

将填充的列添加到现有表

[英]Adding a populated column to an existing table

I have 2 table that have table counts in them. 我有2个表,其中有表计数。 Something like Table 1: 如表1所示:

New_Counts
100

Table 2: 表2:

Old_Counts
97

I want to create a single QC table so I can eventually check that the counts are increasing: 我想创建一个QC表,以便最终检查计数是否在增加:

New_Counts|Old_Counts
100|97

Any ideas how to do this in SQL? 任何想法如何在SQL中执行此操作? A join won't work since the counts are never the same. 联接将无法正常工作,因为计数永远不会相同。

select newcount,oldcount
from (select
    (select count(*) newcount from table1) newcount,
    (select count(*) oldcount from table2) oldcount
    from dual); 

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

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