Answer the question
In order to leave comments, you need to log in
How to search across multiple fields in a table?
There is a table containing a bunch of fields, including a dozen text fields.
Is it possible to build a query in such a way that it searches for a specific word in all text fields? For example "test".
Of course, you can spawn a bunch of LIKEs. Or write a script (I work in php) that will generate all these likes so as not to write manually. But I wonder if it is possible to do it beautifully using SQL? And if possible, I would like to see an example :)
Answer the question
In order to leave comments, you need to log in
you can add (text string concatenation) all columns and search as a result of addition - there will be less LIKEs and ORs
It is possible to make through the data dictionary the truth already by means of Transact-SQL.
https://professorweb.ru/my/sql-server/2012/level3/...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question