当前位置:网站首页>Substr and substring function usage in SQL
Substr and substring function usage in SQL
2022-07-24 19:51:00 【Total dusk】
sql in substr And substring The usage function
Their functions are similar , Can intercept strings
Grammar introduction 1 :
SUBSTR(str,pos) amount to SUBSTR(str FROM pos)
SUBSTRING(str,pos) amount to SUBSTRING(str FROM pos)
Parameter Introduction
str: The string to be intercepted
pos: The starting position is the number of characters you want to intercept
Be careful :
- The character count of the string is from 1 At the beginning , No 0, If pos Write the value as 0, Will return an empty
- The starting position can be negative , Negative numbers are reciprocal , The last character is -1
- The value returned is from pos Start to finish Substring of
Case study
substr:

substring:

Grammar introduction II :
SUBSTR(str,pos,len) amount to SUBSTR(str FROM pos FOR len)
SUBSTRING(str,pos,len) amount to SUBSTRING(str FROM pos FOR len)
Parameter Introduction
str: The string to be intercepted
pos: The starting position is the number of characters you want to intercept ( The points of attention are the same as above )
len: The length of characters you want to intercept ( Be careful : If this len<1, The result will return null )
result : Return from pos Start , The length is len Substring of
Case study
substr

substring

边栏推荐
- Sword finger offer 48. the longest substring without repeated characters
- Day 10 (inheritance, rewriting and use of super)
- Detailed explanation of ELF format (I)
- Is the incremental update of SQL Server database identified according to the where clause? Can't do stream update? Each table should
- Using videoview to realize video playback in turns
- Xiaomi 12s ultra products are so powerful, but foreigners can't buy Lei Jun: first concentrate on the Chinese market
- strlen函数剖析和模拟实现
- C language implementation of raii
- 02 | 环境准备:如何在windows下安装和配置一个基本的php开发环境?
- Sword finger offer 52. The first common node of the two linked lists
猜你喜欢

Unity2d~ game practice of decrypting Zhou mu (completed in three days)
![[JVM learning 03] class loading and bytecode Technology](/img/b4/9482b02b58580171235fd4c36129e9.png)
[JVM learning 03] class loading and bytecode Technology

strlen函数剖析和模拟实现
Siyuan notes V2.1.2 synchronization problem

从码农转型大音乐家,你只差这些音乐处理工具

Flink Window&Time 原理

From code farmer to great musician, you only need these music processing tools

聊下自己转型测试开发的历程

Look at the interface control devaxpress WinForms - how to customize auxiliary function properties (Part 2)

Summary of articles in 2020
随机推荐
Day 4 (item 1: household income and expenditure records)
【JVM学习04】JMM内存模型
湖仓一体释放全量数据价值,SequoiaDB v5.2线上发布会重磅来袭
day 1
Modbus communication protocol specification (Chinese) sharing
Decorator of function
Introduction and advanced tutorial of Albert duilib
Unity3d eventsystem (event)
Database index: index is not a panacea
Recursion of function [easy to understand]
Unity code imports packages through package manager
From code farmer to great musician, you only need these music processing tools
Day 10 (inheritance, rewriting and use of super)
Codeforces round 580 (Div. 2) c- almost equal [Law]
Redisgraph graphic database multi activity design scheme
Qt| control qscrollbar display position
Maya coffee machine modeling
Sword finger offer 49. ugly number
Meshlab & PCL ISS key points
Create a life cycle aware MVP architecture