我的存储过程需要这个条件,我可以从上下文之外以任何方式访问在内部级别声明的别名吗
这有效: -
SELECT Count(*)
FROM (SELECT id
FROM postdata
WHERE id IN ( 4, 5, 6 )
UNION
SELECT id
FROM (SELECT id,
date_completed
FROM postdata
WHERE id IN ( 1, 2, 3 ))a
WHERE a.date_completed in ( "2012-1-10", "2012-10-02" ) )b
有没有可能使这项工作
SELECT Count(*)
FROM (SELECT id
FROM postdata
WHERE id IN ( 4, 5, 6 )
UNION
SELECT id
FROM (SELECT id,
date_completed
FROM postdata
WHERE id IN ( 1, 2, 3 ))a)b
WHERE a.date_completed IN ( "2012-1-10", "2012-10-02" )