selectrecdate,sum(a1)from表1whereflag=0groupbyrecdate
unionall
selectrecdate,sum(a12)from表2groupbyrecdate
如果不是你想要的,可以这样:
selectrecdate,sum(a1)
from(selectrecdate,a1from表1whereflag=0
unionall
selectrecdate,a12from表2)b
groupbyrecdate
首页 >
selectrecdate,sum(a1)from表1whereflag=0groupbyrecdate
unionall
selectrecdate,sum(a12)from表2groupbyrecdate
如果不是你想要的,可以这样:
selectrecdate,sum(a1)
from(selectrecdate,a1from表1whereflag=0
unionall
selectrecdate,a12from表2)b
groupbyrecdate