列名无效,请大家帮忙,在线等待

zizi888 2008-07-09 11:41:27
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: 列名 '用户帐号' 无效。
...全文
94 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
Magic_YJL 2008-07-09
  • 打赏
  • 举报
回复
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 …

中间应该加个空格吧
Magic_YJL 2008-07-09
  • 打赏
  • 举报
回复
的确很乱,都不想看
HolyPlace 2008-07-09
  • 打赏
  • 举报
回复
d.用户帐号 = '123'
chengqscjh 2008-07-09
  • 打赏
  • 举报
回复
用户帐号 = '123' 该成d.account_id = '123'
GhostAdai 2008-07-09
  • 打赏
  • 举报
回复
用户帐号 = '123' 改为 d.account_id = '123' 试试,实在太乱了,没细看,直觉是这个出问题。
RichardSzwz 2008-07-09
  • 打赏
  • 举报
回复
代码真乱,
请整理一下,高手才喜欢看啊!
bbbbbb888888 2008-07-09
  • 打赏
  • 举报
回复
d. 用户帐号

110,031

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧