Skip to content
Advertisement

How to select a row who has a substring

I have and data like :

ID term score
1 enthusiastic 0.986
2 excellence 0.984
3 loves 0.984
4 inspirational 0.984
5 proud 0.68
6 love 0.90
7 so proud 0.71
8 so so proud 0.90

I want to get a score whose term includes ‘proud’. I searched but can’t find anything. As you know SELECT * FROM table_name WHERE term = 'proud' will return just term who has 'proud' certainly (will return 5 proud 0.68 only). I think the problem is so easy but My mind is freeze now.

Thanks for helping

Expected Output:

5 proud 0.68
7 so proud 0.71
8 so so proud 0.90

Advertisement

Answer

use like operator instead of =

SELECT * FROM table_name WHERE term like '%proud%'
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement