Adding a populated column to an existing table

我们两清 提交于 2020-01-16 19:40:14

问题


I have 2 table that have table counts in them. Something like Table 1:

New_Counts
100

Table 2:

Old_Counts
97

I want to create a single QC table so I can eventually check that the counts are increasing:

New_Counts|Old_Counts
100|97

Any ideas how to do this in SQL? A join won't work since the counts are never the same.


回答1:


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


来源:https://stackoverflow.com/questions/56693468/adding-a-populated-column-to-an-existing-table

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!