Here is my simplified code (little more than some basic elements to cause the SQL not to execute):
select *
from (
select replace(mytxtfield, "llama", "") as badones
from XYZ
)
where badones is not null;
The outer query runs fine when the WHERE cause is:
badones like "ZZZ-[0-9][0-9][0-9]"
but it breaks when the WHERE cause includes more than one LIKE (of any digit matching pattern) such as:
badones like "ZZZ-[0-9][0-9]" OR
badones like "ZZZ-[0-9][0-9][0-9]"
More info:
Since your sub-query returns the alias "badnews", you must use it in place of "badones" in your outer query. The following produces no errors:
SELECT *
FROM (select replace(mytxtfield, "llama", "") as badnews
from XYZ
)
WHERE (((badnews) Like "ZZZ-[0-9][0-9]" Or (badnews) Like "ZZZ-[0-9][0-9][0-9]"));
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.