Reputation: 33
I have username made of firstname+lastname+'some number' like "johndoe123" as a string in Android. And I have sqlite table with frequent English first and last names. Table "names" with column "firstName" and column "lastName".
How to check is this username contain any of those from this table?
Is it possible to do this on sqlite side or I need to send letter by letter and wait for response and check until there is no more letter or its equal to column value? Thanks
Upvotes: 0
Views: 69
Reputation: 164099
To get the rows from the table names
that are contained inside the username johndoe123
you can use the operator LIKE
:
select * from names
where 'johndoe123' like '%' || firstname || '%' or 'johndoe123' like '%' || lastname || '%'
Upvotes: 1