2014-10-16 304 views

回答

0

如果格式是一致的(即,在表A中的ID的前8个字符是等于在表B中的ID),则可以加入使用前8个字符:

select 
    table_a.id as table_a_id, 
    case when table_b.id is null then 'Missing' else 'Not missing' end as status 
from table_a 
left outer join table_b 
on substr(table_a.id, 1, 8) = table_b.id 
相关问题