Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Reporting with SQL!
You have completed Reporting with SQL!
Preview
You can obtain lengths of pieces of text using the LENGTH() function.
To obtain the length of a value or column use the LENGTH() function.
SELECT LENGTH(<value or column>) FROM <tables>;
Cheat Sheets
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
They're updating the design
on a customer profile page.
0:00
They want to know the length of
the largest user name in the database
0:01
to test out if their design works at
the extremes of what's in our database.
0:04
We can use the SQL function called
length to help us answer this question.
0:10
We have a select statement that
only brings back the username
0:16
from our customers table.
0:19
Let's show the username and their
length of the username in the report so
0:21
we can verify that it's actually working.
0:25
Remember, a function starts with
the name of the function, length,
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up