In development, you sometimes need to query records with the symbol of the query condition in several fields, but you do not want to create a field to save the content of the field mentioned above. In the general method, it is to first query field 1, then query field 2, then query field 3, combine the content of the three fields, and then return to the customer.
In this way, I create a view_temp view based on the tables of these fields to temporarily process the table,
Select: Select Top 100 *
From (select Field 1 + Field 2 + Field 3 + field 4 as new field from view_temp) derivedtbl
Where new field like '% condition to be queried %'
Append one point:
The derivedtbl keyword must be added as long as the selection operation is performed from the result set. It is mainly used in multi-nested queries!
Continue:
I searched the internet. Here, derivedtbl only adds an alias to the subquery by the system. This can also be changed to another name!