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

推荐订阅源

爱范儿
爱范儿
博客园_首页
W
WeLiveSecurity
S
Secure Thoughts
S
Security @ Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Hugging Face - Blog
Hugging Face - Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
H
Hacker News: Front Page
Project Zero
Project Zero
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
U
Unit 42
N
News and Events Feed by Topic
N
News and Events Feed by Topic
Hacker News - Newest:
Hacker News - Newest: "LLM"
Forbes - Security
Forbes - Security
T
Tor Project blog
I
Intezer
B
Blog
F
Full Disclosure
Security Archives - TechRepublic
Security Archives - TechRepublic
F
Fortinet All Blogs
Schneier on Security
Schneier on Security
T
Threat Research - Cisco Blogs
AI
AI
Google DeepMind News
Google DeepMind News
L
LINUX DO - 最新话题
Cloudbric
Cloudbric
L
Lohrmann on Cybersecurity
WordPress大学
WordPress大学
博客园 - 聂微东
雷峰网
雷峰网
P
Privacy International News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
PCI Perspectives
PCI Perspectives
Y
Y Combinator Blog
Spread Privacy
Spread Privacy
Simon Willison's Weblog
Simon Willison's Weblog
罗磊的独立博客
Vercel News
Vercel News
A
Arctic Wolf
The Register - Security
The Register - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
H
Heimdal Security Blog
Know Your Adversary
Know Your Adversary
P
Proofpoint News Feed
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed

博客园 - e旋风

异常码汇总 搬家公司管理系统,能完成车辆管理、订单管理等工作,并给出报表统计数据 Win7系统上华为无线上网卡与VMware冲突导致驱动无法正常安装的解决办法 VMware 中禁用虚拟内存加速虚拟机速度 Thread & ThreadPool 的一些背景知识 - e旋风 [转]WinForm数据绑定--BindingContext C#中字符数与字节数的区别 - e旋风 - 博客园 世联地产软件工程师笔试试题 HttpRuntime.Cache 与HttpContext.Current.Cache的疑问 配置节处理程序声明 - e旋风 - 博客园 判断是否存在在父结果集中有而在子结果集中没有的记录的最佳方法 动态执行Sql语句与临时表的问题(对象名无效) 定义局部变量时,字符串不能超过8000的方法 我搜集的关于工作流方面的技术文章 只有设置为InProc,Session失效时才会触发Session_End asp.net用户控件中使用相对路径问题 a href=#与 a href=javascript:void(0) 的区别 打开新窗口链接的几种办法 只能输入汉字,数字,英文大小写,符号只允许,。!的正则表达式 HTML及XML语言的转义字符
注意Transact-SQL中Case函数的两种用法导致不同的结果集
e旋风 · 2006-09-22 · via 博客园 - e旋风

SELECT  A.GCMC AS FNAME,A.JSDW AS FOWNER,case
when b.fid  IS NULL then -1 else b.fid end  as farea,

a.CONTENT AS FCONTENT,A.UPDATETIME AS FTIME,NULL AS FHREF,A.DELETED AS  FISDEL

 FROM Z_bidding A LEFT JOIN CCIC_AREA B ON charindex(b.fname,a.areaid)>0

SELECT  A.GCMC AS FNAME,A.JSDW AS FOWNER,case  b.fid
when  NULL then -1 else b.fid end  as farea
,
a.CONTENT AS FCONTENT,A.UPDATETIME AS FTIME,NULL AS FHREF,A.DELETED AS  FISDEL

 FROM Z_bidding A LEFT JOIN CCIC_AREA B ON charindex(b.fname,a.areaid)>0

执行的结果是不一样的

A.使用带有简单 CASE 函数的 SELECT 语句

USE AdventureWorks;
GO
SELECT   ProductNumber, Category =
      
CASE ProductLine
         
WHEN 'R' THEN 'Road'
         
WHEN 'M' THEN 'Mountain'
         
WHEN 'T' THEN 'Touring'
         
WHEN 'S' THEN 'Other sale items'
         
ELSE 'Not for sale'
      
END,
   Name
FROM Production.Product
ORDER BY ProductNumber;
GO


B.使用带有简单 
CASE 函数和 CASE 搜索函数的 SELECT 语句

USE AdventureWorks;
GO
SELECT   ProductNumber, Name, 'Price Range' = 
      
CASE 
         
WHEN ListPrice =  0 THEN 'Mfg item - not for resale'
         
WHEN ListPrice < 50 THEN 'Under $50'
         
WHEN ListPrice >= 50 and ListPrice < 250 THEN 'Under $250'
         
WHEN ListPrice >= 250 and ListPrice < 1000 THEN 'Under $1000'
         
ELSE 'Over $1000'
      
END
FROM Production.Product
ORDER BY ProductNumber ;
GO