易截截图软件、单文件、免安装、纯绿色、仅160KB

求一SQL语句 - MS-SQL Server / 应用实例

数据库表A
ID Weight VolWeight
1 10 6
2 5 8
3 1 3
4 12 7
5 11 2
6 3 5

需要得到如下表内容,要怎样实现
ID OUTWeight 
1 10
2 8
3 3
4 12
5 11
6 5



SQL code:
select id, case when weight>volweight then weight else volweight end OUTweight
from [Table]


SQL code:
select id , OUTWeight = (case when Weight > VolWeight then Weight else VolWeight end ) from a


引用
SQL code
select id, case when weight>volweight then weight else volweight end OUTweight
from [Table]

up

SQL code:
create table a (ID int,Weight int,VolWeight int)
insert into a values(1 ,10, 6)
insert into a values(2 ,5 ,8)
insert into a values(3 ,1 ,3)
insert into a values(4 ,12, 7)
insert into a values(5 ,11, 2)
insert into a values(6 ,3 ,5)
go

--1
select id , OUTWeight = (case when Weight > VolWeight then Weight else VolWeight end ) from a

--2
select id


相关问答:

MS SQL作业问题 - MS-SQL Server / 应用实例

如何在SQL2005中设定定时作业,比如说定时清理某些表的数据,
或者是定时的将某些表的数据导出excel!
在线等待,急急急,最好是详细步骤!
之前我做的作业有点问题!
帮UP

参考:http://hi.baidu.com/toiota ......

vs2008 连接mysql? - MS-SQL Server / 基础类

请问
添加新数据源->数据库->添加连接
这个界面下,数据源选择:Microsoft SQL Server (SqlClient);
服务器名:
应该写什么呢?
有谁知道?多谢各位!!
你到底是要连mysql还是mssql?

引用
请问
......

Sql语句出错, - Web 开发 / ASP

运行后报错误如下:
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] 语法错误 (操作符丢失) 在查询表达式 '数学 + 4where 姓名='王静'' 中。
......

SQL server分解XML - MS-SQL Server / 应用实例

下面是XML初始文件内容
XML code:
<upd:Update xmlns:lar="http://schemas.microsoft.com/msus/2002/12/LogicalApplicabilityRules" xmlns:cmd="http://schemas.microsoft.com/msus/2002/12/Up ......

SQL语句问题 - MS-SQL Server / 疑难问题

请教高手:
 以下是数据库中的三条记录,英文为字段名称  
  id planname TaskBeginTime Status
329 2010年03 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号