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

推荐订阅源

Forbes - Security
Forbes - Security
T
Tailwind CSS Blog
Hugging Face - Blog
Hugging Face - Blog
Blog — PlanetScale
Blog — PlanetScale
WordPress大学
WordPress大学
aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
U
Unit 42
I
InfoQ
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V
Visual Studio Blog
B
Blog RSS Feed
Vercel News
Vercel News
F
Fortinet All Blogs
Know Your Adversary
Know Your Adversary
T
Troy Hunt's Blog
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
大猫的无限游戏
大猫的无限游戏
A
About on SuperTechFans
Jina AI
Jina AI
小众软件
小众软件
T
Threatpost
有赞技术团队
有赞技术团队
人人都是产品经理
人人都是产品经理
The Hacker News
The Hacker News
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
Scott Helme
Scott Helme
B
Blog
腾讯CDC
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
S
Schneier on Security
N
News and Events Feed by Topic
Microsoft Security Blog
Microsoft Security Blog
K
Kaspersky official blog
G
Google Developers Blog
T
Tor Project blog
PCI Perspectives
PCI Perspectives
S
Secure Thoughts
Google Online Security Blog
Google Online Security Blog
Latest news
Latest news
Google DeepMind News
Google DeepMind News
MyScale Blog
MyScale Blog
罗磊的独立博客

博客园 - Jackie Yao

美国vps哪个比较好,vps国内访问速度最快! http://t.sohu.com/u/416461865 吃什么水果减肥? GPS导航仪准确度遭质疑-www.daohang2012.com GPS导航仪把车“导”进海-www.daohang2012.com 广州虚拟主机 www.48wo.com boxy 你用了吗?? 赞一个 mssql2005 的并发处理. js 繁体转简体 The Digital Lifestyle Developer Blog[推荐] [转]escape,encodeURI,encodeURIComponent函数比较 正则表达式大全. YAHOO工具库提供的方法[转贴] {转}sql日期格式转换 [转]html控件、html服务器控件和web服务器控件的区别 [收藏]ASP.NET的底层的工作机制介绍 [转]asp.net2.0实现treeview无限级菜单树 [转]asp.net 2.0 TreeView客户端个性化控制 Build Google IG like Ajax Start Page in 7 days using ASP.NET Ajax and .NET 3.0 ASP.NET Application Life Cycle Overview for IIS 5.0 and 6.0
sql05 变量小技巧
Jackie Yao · 2012-02-20 · via 博客园 - Jackie Yao

不知道大家用过没,

最近做一网站,无聊发现的。可能自己孤陋寡闻吧!!

declare @table table
(

     id int

)

INSERT INTO @table values('-1')
INSERT INTO @table values('0')
INSERT INTO @table values('1')

declare @t varchar(10)

set @t = '(1,0)'

select * from @table  where id in @t

大家注意 红色部分,这样写的话 语法是不通过的。

有人会说,可以把sql 放到变量里,再来一个exec(@sql)

但是我觉得这样不是很好,况且我在.net 的dataset 里,这样用objectdatasource 设定一个 dataset ,gridview 才可以自动排序嘛。

所以有什么办法解决呢!!!!苦思!经过无数的失败尝试!

可以这样解决,同样用到临时表!!

select * from @table  where id in (select id from @table1)

同样用到临时表!这样就通了!具体就不写了!是好是坏,分享一下!