惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Know Your Adversary
Know Your Adversary
博客园 - 叶小钗
量子位
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 【当耐特】
博客园 - Franky
有赞技术团队
有赞技术团队
博客园 - 聂微东
腾讯CDC
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Jina AI
Jina AI
Last Week in AI
Last Week in AI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Cloudbric
Cloudbric
WordPress大学
WordPress大学
W
WeLiveSecurity
V2EX - 技术
V2EX - 技术
博客园_首页
S
Security @ Cisco Blogs
The Last Watchdog
The Last Watchdog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Security Latest
Security Latest
L
Lohrmann on Cybersecurity
T
Threat Research - Cisco Blogs
Forbes - Security
Forbes - Security
宝玉的分享
宝玉的分享
The Register - Security
The Register - Security
The Hacker News
The Hacker News
B
Blog RSS Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
Schneier on Security
Schneier on Security
T
Troy Hunt's Blog
The GitHub Blog
The GitHub Blog
Hacker News: Ask HN
Hacker News: Ask HN
Spread Privacy
Spread Privacy
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
GbyAI
GbyAI
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
罗磊的独立博客
Blog — PlanetScale
Blog — PlanetScale
M
MIT News - Artificial intelligence
T
Tor Project blog
S
Security Affairs
Security Archives - TechRepublic
Security Archives - TechRepublic
NISL@THU
NISL@THU
P
Proofpoint News Feed
C
Cyber Attacks, Cyber Crime and Cyber Security

博客园 - 落木

PowerDesigner中NAME和COMMENT的互相转换,需要执行语句 获取网站根目录的urli源代码 - 落木 - 博客园 Control的Invoke和BeginInvoke 用.net的GetCallbackEventReference函数来实现dropDownList联动的ajax效果 处理SQLSERVER死锁(转载) 调用DirectX进行简单的多媒体编程系列(四) 调用DirectX进行简单的多媒体编程系列(三) 调用DirectX进行简单的多媒体编程系列(二) 调用DirectX进行简单的多媒体编程系列(一) 数据库分页算法 mysql想说爱你不容易啊,从mssql迁移到mysql时,几乎所有的存储过程都得改,语法相差很大,累人!! 自己写的sqlserver和mysql的行转列通用存储过程 MSSQL优化文章 C#中编写sqlserver中自定义函数,实现复杂报表 Ajax使用Post方式提交到.aspx页面交互的例子 核单台帐表(存储过程) 清欠率(存储过程) ExtJS中的面向对象设计,组件化编程思想 - 落木 - 博客园 ExtJS中如何扩展自定义的类
扩大范围的多条件查询
落木 · 2010-05-11 · via 博客园 - 落木

代码

declare @TempTab Table(id int,a varchar(50),b varchar(50),c varchar(100));
insert into @TempTab(id,a,b,c) values(1,'aaa111','bbb111','ccc111');
insert into @TempTab(id,a,b,c) values(2,'aaa222','bbb222','ccc222');
insert into @TempTab(id,a,b,c) values(3,'aaa333','bbb333','ccc333');
insert into @TempTab(id,a,b,c) values(4,'aaa444','bbb444','ccc444');
insert into @TempTab(id,a,b,c) values(5,'aaa555','bbb555','ccc555');
select * from @TempTab;declare @q_a varchar(50);
declare @q_b varchar(50);
declare @q_c varchar(50);
set @q_a='aaa111';
set @q_b='bbb222';
set @q_c='ccc111';
--set @q_a='aaa111';
--
set @q_b='bbb222';
--
set @q_c='ccc333';

declare @count int
select @count=count(*from @TempTab where a=@q_a and b=@q_b and c=@q_c
if @count>0
    
begin
        
select * from @TempTab where a=@q_a and b=@q_b and c=@q_c
    
end
else
    
begin
        
select @count=count(*from @TempTab where (a=@q_a and b=@q_bor (a=@q_a and c=@q_cor (b=@q_b and c=@q_c)
        
if @count>0
            
begin
                
select * from @TempTab where (a=@q_a and b=@q_bor (a=@q_a and c=@q_cor (b=@q_b and c=@q_c)
            
end
        
else
            
begin
                
select @count=count(*from @TempTab where a=@q_a or b=@q_b or c=@q_c
                
if @count>0
                    
begin
                        
select * from @TempTab where a=@q_a or b=@q_b or c=@q_c
                    
end
                
else
                    
begin
                        
select * from @TempTab
                    
end
            
end
    
end

代码

declare @orgcity varchar(200);
declare @dstcity varchar(200);
declare @FromTime DATETIME;
declare @flightNo varchar(50);
declare @AirCompanyCode varchar(50);
declare @CabinType varchar(50);set @orgcity='CAN';
set @dstcity='XIY';
set @FromTime='2010-05-08 00:00:00:000';
set @flightNo='cz3208';
set @AirCompanyCode='cz';
set @CabinType='u';SELECT * FROM SpecialManager where 
(
@FromTime between Orgdate and DstDate and orgcity like '%'+@orgcity+'%' and dstcity like '%'+@dstcity+'%' and specialType=0)SELECT  top 1 * FROM SpecialManager where (@FromTime between Orgdate and DstDate and orgcity like '%'+@orgcity+'%' and dstcity like '%'+@dstcity+'%' and specialType=0and (flightNo=@flightNo  OR ISNULL(flightNo,'')=''AND (AirCompanyCode=@AirCompanyCode  OR ISNULL(AirCompanyCode,'')=''AND (CabinType like '%'+@CabinType+'%'  OR ISNULL(CabinType,'')=''ORDER BY AirCompanyCode desc,flightNo desc,CabinType desc