How to use a similar operator for complex query in sqlite

Hi everyone, I have the following table called student in SQLite database.

this is my table structure

id       name
-----------------------

"3"  "Babu Qw"  
"2"  "Ganesh Babu"  
"1"  "Murali  Abb"  
"4"  "ganesh1 Babu"             
"5"  "hari murali"              
"10" "Abbash abc"   
Name field

united by name and surname. for example, "Babu Qw" Babu is the first name, and Qw is his last name, separated by a space.

and the name is the input field, where "ba" is my input parameter. ( Ex .. name like 'ba' )

now I want to get records regardless of the first name (first or last name) begins with 'ba' not using any middle character.

:

id       name
-----------------------

"3"  "Babu Qw"  
"2"  "Ganesh Babu"  
"4"  "ganesh1 Babu" 

here "Abbash abc" (the name of the abbash or the last name abc does not start with ba), so "Abbash abc" is not specified.

+3
source share
2

:

select id, name
from table
where name like 'Ba%' or name like '% Ba%'
+7

REGEXP SQLite? -

SELECT * FROM table WHERE name REGEXP('^ba.*') OR name REGEXP('^.* ba.*');

. , , . .

+1

All Articles