How could I do a SQL query by inserting a string with words in any order? For example find a row that has in some column the following String: "my dog is called spike" inserting in a like something like "dog my llama spike"
Let's see the following example:
create table demo(
texto varchar(255)
);
insert into demo(texto) values ('mi perro se llama spike');
insert into demo(texto) values ('mi perro se llamarada spike');
insert into demo(texto) values ('mi perro dinamita');
insert into demo(texto) values ('mi perro se llama spike y mi gato felix');
insert into demo(texto) values ('perro mi llama se spike');
The idea would be: to be able to search for a series of words (all should appear), within the text column, so that if we search for perro mi llama se spike
, the result should be:
texto
--------------------------------------
mi perro se llama spike
perro mi llama se spike
mi perro se llama spike y mi gato felix