1、update myTable set vipczz=vipczz+1 where vip=1
2、update myTable set vipczz=vipczz-1 where vip=0
select tid, a.sum-b.sumfrom (select tid, sum(num) as sum from A order by tid)a,
(select tid, sum(num) as sum from B order by tid)b
where a.tid = b.tid
试一下上面的sql语句行不行
按照你的意思,其实就是将两个结果集Union起来,没有值的话即为Null如下:
select
时间,字段2,字段3,null
as
字段4,null
as
字段5
from
a
union
all
select
时间,null
as
字段2,null
as
字段3,字段4,字段5
from
b
解释:因为...
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)