select top 1 * from table where xcode =1
union
select top 1 * from table where xcode =2
union
select top 1 * from table where xcode =3
union
select top 1 * from table where xcode =2
union
select top 1 * from table where xcode =3
解决方案 »
- SQL SERVER 2008登录提示
- sql查询问题
- 将现有表数据插入新表
- 用"BCP"导数时,出现"'bcp' 不是内部或外部命令,也不是可运行的程序"的提示
- 求一个简单sql语句 急!!!
- 关于数据库二进制字段的疑问
- 同时删除多个大表记录导致日志文件剧增的解决方案讨论
- 有关查询表中已删除的id号的问题
- 安装问题`!急`!
- VB真的不行吗,那么SQL SERVER应该行吧,一个有点难度的问题,在VFP中可以快速统计,可VB中我做不到,那么用存储过程有没有用,希望大家帮我一下,这是一个有点麻烦的统计!
- 有哪位对临时表有研究,请各位大虾帮忙了!!!!!!
- 高分送上!简单的安装问题! SQL SERVER 的MSDE(Microsoft Desktop Engin)
select telNo,xcode,min(money) as money from table where xcode=1 union
select telNo,xcode,max(money) as money from table where xcode=2 union
select telNo,xcode,max(money) as money from table where xcode=3
select top 1 * from table where xcode =1 order by telNo
union
select top 1 * from table where xcode =2 order by telNo
union
select top 1 * from table where xcode =3 order by telNo^_^
where telNo = (select min(telNo) from yourtable where xcode = A.xcode)
select max(telno) as telNo,xcode,max(money) as money
from table
group by xcode