Like Operator | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

Like Operator

What should i type to get only, the names that have 4 characters only? Pls, complete the code Select name from world Where name like

2nd Aug 2020, 3:21 PM
Shaimaa Mohamed
11 Answers
+ 2
Select name from world Where name like '____' ; That's 4 underscores('_') there👆
2nd Aug 2020, 3:25 PM
Arsenic
Arsenic - avatar
+ 2
Shaimaa Mohamed there is no need to put parentheses, I have put it for explanation purpose only. Every under score in LIKE represents one single character, for 4 characters you have to put 4 of them
2nd Aug 2020, 3:35 PM
Arsenic
Arsenic - avatar
+ 1
Arsenic great i understand 👌 Would you help me, if i want to return the values with the same exactly name (Ex. One called Richard Richard so i want to return both) Select name from world Where name like
2nd Aug 2020, 3:41 PM
Shaimaa Mohamed
+ 1
Shaimaa Mohamed for that use :- Where name = "Richard";
2nd Aug 2020, 3:44 PM
Arsenic
Arsenic - avatar
+ 1
Arsenic I don't know exactly the people with the same surname and forename And I want to return all of them, get me?😉
2nd Aug 2020, 3:46 PM
Shaimaa Mohamed
+ 1
For that you must be having an surname attribute also in the table.
2nd Aug 2020, 4:19 PM
Arsenic
Arsenic - avatar
+ 1
I don't get it But i do appreciate your help 🌹
2nd Aug 2020, 4:20 PM
Shaimaa Mohamed
0
I want to make sure that I understood correctly, you want to select a name ( from, let's say, an array of character's names) that have only 4 letters on them?
2nd Aug 2020, 3:27 PM
Agustin Melo
Agustin Melo - avatar
0
Agustin Melo he/she is asking for SQL query.
2nd Aug 2020, 3:28 PM
Arsenic
Arsenic - avatar
0
Arsenic thanx🤗 would you explain why we put it in parenthesis?
2nd Aug 2020, 3:30 PM
Shaimaa Mohamed
0
Agustin Melo i want to return the names which have 4 letters only
2nd Aug 2020, 3:32 PM
Shaimaa Mohamed