For the two sentences of "or" SQL ", how does the ike sort data by the like sequence? Name & nbsp; LIKE & nbsp; % A % & nbsp; OR & nbsp; time & nbsp; LIKE & nbsp; % B % how to finish like & nbsp; result of A & nbsp; in the row & nbsp; result of B? ------ Solution ---------- How does ike of the two SQL statements of "or" sort data by "like?
Name LIKE "% A %" OR time LIKE "% B %"
How can I finish the result of like A in B?
------ Solution --------------------
... Order by if (instr (name, 'A')> 0, 0) desc
------ Solution --------------------
This half sentence is understandable.
That is to say, convert the string containing 'a' to 0, 1, and sort the string by 01. the string contains 1, and the string that does not contain 0.
The final sorting is order by if (instr (name, 'A')>, 0) desc
------ Solution --------------------
The same. I used the same statement in the preceding statement. I can't even understand it?
Order by if (instr (name, 'A')> 0, 1, (if (instr (name, 'B')> 0, 1, (if (instr (name, 'E')> 0, 1) desc