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

推荐订阅源

The Register - Security
The Register - Security
IT之家
IT之家
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
S
SegmentFault 最新的问题
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
The Cloudflare Blog
T
The Blog of Author Tim Ferriss
Apple Machine Learning Research
Apple Machine Learning Research
C
Check Point Blog
Microsoft Azure Blog
Microsoft Azure Blog
V
V2EX
量子位
F
Fortinet All Blogs
Martin Fowler
Martin Fowler
大猫的无限游戏
大猫的无限游戏
Last Week in AI
Last Week in AI
博客园 - 聂微东
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
Google DeepMind News
Google DeepMind News
宝玉的分享
宝玉的分享
M
MIT News - Artificial intelligence
U
Unit 42
罗磊的独立博客
MyScale Blog
MyScale Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V
Visual Studio Blog
Jina AI
Jina AI
Recorded Future
Recorded Future
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
小众软件
小众软件
H
Help Net Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
B
Blog
J
Java Code Geeks
爱范儿
爱范儿
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
aimingoo的专栏
aimingoo的专栏
B
Blog RSS Feed
月光博客
月光博客
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy International News Feed
Know Your Adversary
Know Your Adversary
雷峰网
雷峰网

博客园 - 牵牛望岳

ICloneable 接口--c# 深复制与浅复制 IDisposable接口详解 C# 中用 PadLeft、PadRight 补足位数 listbox控件的一些操作 IsPostBack用法,Page.IsValid的用法 IIf函数 替换、恢复Html中的特殊字符 C#连接数据库的一些鲜为人知的方法 C#关键字 【推荐】常用 SQL 语句大全 CSS中的黄金分割率 解析.net中ref和out的实质 JavaScript substr() 和 substring() 方法的区别 武林外传搞笑语录 调试和跟踪 VS2005单元测试[转] 几个.Net开源的CMS、Portal系统 DataKeyNames工作 查询后,翻页问题的解决办法2。(GridView1.PageIndex = e.NewPageIndex;) (转)
几条相关SQL语句
牵牛望岳 · 2008-11-07 · via 博客园 - 牵牛望岳

1、说明:复制表(只复制结构,源表名:a 新表名:b)(Access可用)

法一:select * into b from a where 1<>1

法二:select top 0 * into b from a

2、说明:一条SQL语句搞定数据库分页

select top 10 b. * from (select top 20 主键字段,排序字段 from 表名 order by 排序字段 desc) a,表名 b where b.主键字段 = a.主键字段 oredr by a.排序字段

3、说明:前10条记录

select top 10 * from table1 where 范围

4、说明:随机取出10条数据

select top 10 * from tablename order by newid() 

5、说明:选择从10到15的记录

select top 5 * from (select top 15 * from table order by id asc) table_别名order by id desc

6、SQL left()函数、len()函数

LEFT()   返回从字符串左边开始指定个数的字符(而不是字节).  

select   left(name,10)   from   member        
  如果name="123456中国910"  
  返回值是“123456中国91"  

len()函数统计的是字符(而不是字节)的个数

table   a    
  id     name  
  1       abc  
  2       张三  
  通过sql   查询,select   len(name)   from   a   得到如下结果:  
  1     3  
  2     2