select o.username,
o.uagent,
o.cscode,
o.product,
(SELECT min(time.createTime)
FROM (select t.createtime
from dataintegration t
where t.username = o.username
union all
select t.user_create_time
from diuser t
where t.user_name = o.username) time) createTime
from dataintegration o
里面会报o.username无效,到底是什么问题?怎么解决?o表里一定有username字段,拜托大家