+ 1
SQL
I am new to SQL. I am writing a script to select all last names in database student that ends with upper case T And is at least 3 characters long in length. I know for upper case letter is SELECT * FROM Student WHERE StudentLastName LIKE ‘%S’; But what about length? Please help!
8 Antworten
+ 4
Knowledge Is Power
You can use len function
len(name) >= 3
+ 1
Knowledge Is Power
In Feed Posts
+ 1
Knowledge Is Power
Do you see Posts in your profile?
+ 1
Got it A͢J I just posted there. Thank you👍
+ 1
Hey. Use
SELECT * FROM STUDENT WHERE STUDENTLASTNAME LIKE ‘%T’
To get the data that ends with T
0
A͢J Do you how can i share ERD diagram at Sololearn?
0
A͢J where is feed post. I see Q&A and code playground. Where is feed post?
0
The ? symbol can be used as a wildcard placeholder that represents 1 unknown character. Change the LIKE clause to look like this:
StudentLastName LIKE '%??T'