数据库有两个字段:帖子数和主题数
想要查询:今天的帖子数和主题数的总和,日期是今天,请问SQL语句怎么写?
select 总和=帖子数+主题数 from table where 日期=今天
引用
select 总和=帖子数+主题数 from table where 日期=今天
这回复太强了,顶
引用
select sum(帖子数)+sum(主题数) as 合计 from table ......
SQL code:
select a.transactionid, a.creator, a.creattime, a.updatetime,
a.status, a.handletimes, a.operatetype, a.objecttype,
a.objectid, a.objectname, a.objecturl, a.nettype,
a.netid, a.returntime, a.returncode, a.returndesc, a.netstatus,b.netname
from t_cms_trans ......
有这样一张图片表 Pic ,每张图片都有企业编号和一个类型编号
包括图片的编号 ID ,企业的编号 EntId,图片类型的编号 Type ID ,图片的名称 Title
ID EntID TypeId Title
......
我们 服务器 重装了系统,在装完sql2000之后,webconfig连接数据库 是 IP地址形式,以前本地是(localhost),怎么配置远程连接?
在线 等,比较急
没看懂,
远程就写ip或计算机名
引用
没看懂,
远程就写ip或计算机名
。。
An error has occurred while establishing a connection to the server. Whe ......
sql2000存储过程分页,能返回总记录数
自己占 沙发
网上大堆
也得mark
create procedure procedureName
@pageIndex int,
@pageSize int,
@pageCount int output,
@count int output
as
set @count=(select count(1) from tableName)
if(@count%@pageSize=0)
begin
set @pageCount=@count/@ ......
select * from dbo.[Report] where ID like %1% or Report_num like %1% or ID like %ehs% or Report_num like %ehs% order by ID ;
消息 102,级别 15,状态 1,第 1 行
'1' 附近有语法错误。
select * from dbo.[Report] where ID like '%1% 'or Report_num like '%1% 'or ID like '%ehs% 'or Report_num like ......