select A.log_date,A.log_filtime ,B.realname,B.username,
(select count(*) from tablec where id = A.id) as 该日志的评论数
from tablea as A left join tableb as B on A.username = B.username
where A.username = @某个部门员工
(select count(*) from tablec where id = A.id) as 该日志的评论数
from tablea as A left join tableb as B on A.username = B.username
where A.username = @某个部门员工
解决方案 »
- 如何将这两句sql语句合并起来?
- vc ado 连接sql server 的方式(System DSN Connection,DSN-less Connection 和 OLE DB Connection),解决给分
- 如何优化select col1,col2.... from table 的速度
- 大家帮帮忙啊....................
- 如何判断已存在数值?
- 如何知道一个数据所用到的所有物理文件的路径?
- 怎样将表的所有者由普通用户改为DBO?
- 低分问个弱智的问题select @dt_j=1 select @dt_i=5这两句话,能不能写成select @dt_j=1,@dt_i=5
- 安装sql server 2005 没有插入第二张盘的提示
- 触发器
- 如何让一个视图“今天”的查询结果定时写入一个表里面
- 数据库设计问题,关于删除用户的问题
(select count(*) from tablec where id = A.id) as 该日志的评论数
from tablea as A left join tableb as B on A.username = B.username
where B.username = @dept