列名无效,请大家帮忙,在线等待
select c.*, d.account_id as 用户帐号 from (select b.* from 表名 a join (select user_id as 用户编号, user_tel as 用户电话, reg_dt as 注册时间, unreg_dt as 注销时间, '正常包月用户' as 包月用户状态 from 表名union select user_id as 用户ID , user_tel as 用户电话 , max(reg_dt) as 注册时间, max(unreg_dt) as 注销时间, '已经注销的包月用户' as 包月用户状态 from 表名 where user_tel not in (select user_tel from t_user_vip_info) group by user_id, user_tel ) as b on a.commended_tel = b.用户电话 where a.commended_sence = 4) c left join 表名 d on c.用户编号 = d.user_id and 用户帐号 = '123' order by 注册时间 descSystem.Data.SqlClient.SqlException: 列名 '用户帐号' 无效。