LEFT(string, n)函数,是处理字符数据获取子字符串。第一个参数是将要处理的字符串,第二个参数,是从字符串的左边开始截取的字符个数。

例子:

DECLARE @string NVARCHAR(50) = 'Mr. John'
SELECT LEFT(@string,3) AS [New String] 

结果:

SQL Server LEFT Functions的更多相关文章

  1. Querying Microsoft SQL Server 2012 读书笔记:查询和管理XML数据 2 -使用XQuery 查询XML数据

    XQuery 是一个浏览/返回XML实例的标准语言. 它比老的只能简单处理节点的XPath表达式更丰富. 你可以同XPath一样使用.或是遍历所有节点,塑造XML实例的返回等. 作为一个查询语言, 你 ...

  2. Migrating Oracle on UNIX to SQL Server on Windows

    Appendices Published: April 27, 2005 On This Page Appendix A: SQL Server for Oracle Professionals Ap ...

  3. Part 16 Important concepts related to functions in sql server

    Important concepts related to functions in sql server

  4. Part 14 Mathematical functions in sql server

    Part 29 Mathematical functions in sql server

  5. Part 13 Cast and Convert functions in SQL Server

    Part 28 Cast and Convert functions in SQL Server

  6. Part 15 Scalar user defined functions in sql server

    Scalar user defined functions in sql server Inline table valued functions in sql server Multi statem ...

  7. Part 12 DateTime functions in SQL Server

    DateTime functions in SQL Server IsDate, Day, Month, Year and DateName DateTime functions in SQL Ser ...

  8. Part 11 string functions in sql server

    Built in string functions in sql server 2008 LEFT, RIGHT, CHARINDEX and SUBSTRING functions in sql s ...

  9. SQL Server Window Function 窗体函数读书笔记二 - A Detailed Look at Window Functions

    这一章主要是介绍 窗体中的 Aggregate 函数, Rank 函数, Distribution 函数以及 Offset 函数. Window Aggregate 函数 Window Aggrega ...

随机推荐

  1. WCF技术剖析之二:再谈IIS与ASP.NET管道

    原文地址:http://www.cnblogs.com/artech/archive/2009/06/20/1507165.html 在2007年9月份,我曾经写了三篇详细介绍IIS架构和ASP.NE ...

  2. Rectangle Intersection Test (with C#)

    Rectangle Intersection Test (with C#) by Sebastian Krysmanskihttp://manski.net/2011/05/rectangle-int ...

  3. js-- 一些题目

    1. ~~3.14~~3.14=-((~3.14)+1)=-(-(3.14+1)+1)=-(-(3+1)+1)=-(-4+1) =-(-3)=3 按位非(NOT)(~)操作数的负值减1. 2. var ...

  4. 笔记2:傻瓜式盗QQ程序

    1.一个简单的盗QQ号的方法 仿做一个QQ的窗体 PS:当然里面有用的控件只有两个输入框和一个登陆按钮,其他的尽量做得像一些吧! 点登陆时的后台代码: PS:需要导入两个包:using System. ...

  5. centos将自编译安装的apache添加为linux系统服务

    首先,先谈下对linux服务的理解 1,linux 服务运行方式: 脚本的方式运行,服务脚本存放位置/etc/rc.d/init.d/ 2,linux服务管理软件 chkconfig Red Hat公 ...

  6. CSS水平居中和垂直居中解决方案

    一.CSS 居中 — 水平居中 DIV等标签本身没有定义自己居中的属性,网上很多的方法都是介绍用上级的text-align: center,然后嵌套一层DIV来解决问题. 可是这个方法有时候完全不起作 ...

  7. listview加载性能优化ViewHolder

    在android开发中Listview是一个很重要的组件,它以列表的形式根据数据的长自适应展示具体内容,用户可以自由的定义listview每一列的布局, 但当listview有大量的数据需要加载的时候 ...

  8. VS输入输出基本操作以及数据类型和类型转换

    (一)   C#项目的组成结构 项目结构 .config ---配置文件(存放配置参数文件) .csproj ---项目文件(管理文件项) .sln   ---解决方案文件(管理项目) .cs   - ...

  9. Mysql执行Update操作时会锁住表

    update tableA a,(select a.netbar_id,sum(a.reward_amt) reward_amt from tableB a group by a.netbar_id) ...

  10. 通过电脑(计算机)下载google play的应用的方法

    手机上安装GOOGLE PLAY很麻烦,经常不成功.于是采用电脑下载APK的方法. 网上传说的下载chrome的插件,然后获取DEVICE ID的方法,经过试用,一直无法获得DEVICE ID. 经过 ...