using(id) where id like 'F%' AND director IS NULL and lgid=2
INNER JOIN可取得两个表基于相同id的记录,也便于后面用where设置限定条件;
director为空假定你指的是null,如果不是null,则可将
director IS NULL 改为director=''
create view Myvwas
select Sum(A.a)+sum(A.b)+sum(A.c)+sum(A.d) from A ,B on A.id=B.id where year(B.日期)=year(getdate())
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)