课程: Intermediate SQL for Data Scientists

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Extracting strings from character data

Extracting strings from character data - SQL教程

课程: Intermediate SQL for Data Scientists

Extracting strings from character data

- [Instructor] Sometimes when we work with text, we want to extract a section of a piece of text or a string. So we might want to maybe break off or take off the beginning of a piece of text or extract the end of a piece of text. Well, SQL gives us a number of different ways to do that. So let's start with a really simple example, and let's start with a select and then a series of letters. So we'll start out with letters from the alphabet here at the start of the alphabet, and we'll just run this and make sure. Yep, okay, so when we get back, when we do a select from A through K, we get a string with all the letters A through K, as we might expect. Now sometimes we might decide, it's like, oh, let's take a subsection of that. Well, first thing I want to do is I'm going to alias this as test string. So before I take a subsection, let me just run this. Okay, yeah, so there we have our alias here. Now let's say, for our test string, I want to take a substring. So we'll use the substring…

内容