SQL查询排序,自我比较,启动程序

    System.Diagnostics.Process.Start(@"D:\FoxMail\Foxmail.exe");

select *
from MonthlyEnterpriseMonitor
where cast([Year] AS nvarchar(10))+'-0'+cast([Month] AS nvarchar(10))+'-01 00:00:00'
between '2009-01-01 00:00:00' and '2009-02-28 23:59:59'


declare @t table(id int,   name varchar(10),   Time1 datetime,     Time2 datetime)
insert @t select 1,'AA','2008-5-10','2009-1-1'
insert @t select 2,'AA','2008-11-5',null
insert @t select 3,'BB','2008-5-10','2009-2-14'
insert @t select 4,'BB','2008-8-23','2009-1-5'
insert @t select 5,'BB','2008-9-14','2009-4-1'
insert @t select 6,'CC','2009-2-22',null
insert @t select 7,'CC','2008-10-10','2009-1-10'

select * from @t t where not exists(select 1 from @t where name=t.name and (time1>t.time1 or time2>t.time2))

/*
id          name       Time1                   Time2
----------- ---------- ----------------------- -----------------------
2           AA         2008-11-05 00:00:00.000 NULL
5           BB         2008-09-14 00:00:00.000 2009-04-01 00:00:00.000
6           CC         2009-02-22 00:00:00.000 NULL

(3 行受影响)
*/

 

http://www.cikuu.com/contact.html


select * from dbo.T_Question

where (tag like N'%卡%充积分%' and tag  not like N'%充积分%')

or (tag not like N'%卡%充积分%' and tag  like N'%充积分%')

转载于:https://www.cnblogs.com/z2002m/archive/2009/04/08/1431574.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值