select t.topic_id topicId,
t.topic_tags topicTags,
t.topic_content topicContent,
t.topic_user topicUser
from t_mm_topic t
where t.topic_title like '%'
and exists(
select 1 from (
SELECT REGEXP_SUBSTR(t.topic_tags, '[^|]+', 1, LEVEL) AS tagId
FROM DUAL
CONNECT BY LEVEL <=
LENGTH(t.topic_tags) - LENGTH(REGEXP_REPLACE(t.topic_tags, '\|', '')) + 1) tmt
inner join t_mm_tag ta
on tmt.tagId = ta.tag_id
and (ta.tag_id = '5' or ta.parent_id = '5')
)
order by t.topic_date desc
如题,怎么在最里层嵌套的子查询中引用最上层的别名
where字句中不能出现别名,建议看看sql关键字执行顺序。