Learn how you may find the length of a string using the nonstandard LENGTH() function or its equivalent on your system.
- [Instructor] While the SQL standard does not include…a function for finding the length of a string,…most modern database systems do include one,…and it's usually called length.…So for this lesson,…we'll use the world database,…and I'm just going to type in a simple select statement.…Select length of, and the literal word string,…in single quotes, and a semi colon.…Now, I'll press go and you see…the length of string function returns the number six,…and there are six characters in the literal string, string.…
The length function is really very simple.…It takes a string as its one argument…and returns a number representing the length of that string.…Of course, this is much more useful as part of a query.…So I can select name,…and length of name,…as length,…from city order by the length, descending, and name.…
So, this'll give us a list…of all the name columns from the city database,…sorted by the length of the name,…and within that length by the alphabetical name itself.…So, when I press go,…Google Chrome clearly wants to translate this page for me.…
- Understanding SQL terminology and syntax
- Creating new tables
- Inserting and updating data
- Writing basic SQL queries
- Sorting and filtering
- Accessing related tables with JOIN
- Working with strings
- Understanding numeric types
- Using aggregate functions and transactions
- Automating data with triggers
- Creating views
- Defining functions in PHP
Skill Level Beginner
2. SQL Overview
3. Fundamental Concepts
7. Dates and Times
Dates and times1m 52s
11. Views and Subselects
12. Defined Functions
13. A Simple CRUD Application
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.