It's doable, although I strongly suggest you look into full-text search for efficiency;
To avoid looking for all patterns in all fields one by one, you can just concat and search in that;
SELECT *
FROM (SELECT id,CONCAT(name,'|',text,'|',date,'|',author,'|',status) txt
FROM Table1) a
WHERE txt LIKE '%augusto%'
AND txt LIKE '%2010%'
AND txt LIKE '%text%';
Note that no indexing will help you here, since you're searching in a calculated column. On the other hand, since you're searching with a leading wildcard %searchterm
, you won't get much help from indexes even if searching field by field :)
An SQLfiddle to test with.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…