sql - SQLite select record where a value is within a string -


i have db structured this:

table1

(_id integer primary key autoincrement,  titolo varchar(50) not null,  autore varchar(50) not null,  id_categoria varchar(20) not null,  testo text,  unique(titolo,autore)) 

table2

(_id integer primary key autoincrement,  titolo varchar(50) not null unique,  attiva integer(1) default(0)) 

how can select row table2._id within table1.id_categoria?

tthe table1.id_categoria field "1-2-3-..." want check if integer field _id of table2 in field string id_categoria of table1.

try this:

select table2.*,table1.id_categoria table1,table2  table1._id=table2._id ,  instr(table1.id_categoria, table2._id) 

check this:


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -