You may find the length of a string using the non-standard 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. … We're gong to use the world database for this example. … I'm going to start just by showing you the length function. … The length function is really very simple. … It takes a string as one argument … and returns a number representing the length of a string. … So if I execute this query, … you'll see that the length of the string 'string' is six. … The word string has six letters. … So the return value for the length function … is the number six. … Of course, this is much more useful as part of a query … so we can do something like this. … Select name, … and length of name, … we'll call it as len, … from city, … order by len descending comma name. … So we're going to select the name … and the length of the name as len … from this City table in the world database, … ordered descending by length, and then by name. …
This course was created by Bill Weinman. We are pleased to offer this training in our library.
- How databases are organized
- Selecting rows and columns
- Creating new tables
- Inserting and updating data
- 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
- Using CRUD functions
Skill Level Beginner
2. SQL Overview
3. Fundamental Concepts
7. Dates and Times
Dates and times2m 6s
11. Views and Subselects
12. 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.