SQL 语句报错

lihaibo2006 2010-03-26 05:43:50
select band.*, ac.name, distinct(ac.id)
from umc_user_banding band
left join umc_app_cluster ac on band.app_cluster_id = ac.id

哪里问题啊?
...全文
69 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
sxdtgsh 2010-03-26
  • 打赏
  • 举报
回复
查一查umc_user_banding表里是不是也有name列。
lihaibo2006 2010-03-26
  • 打赏
  • 举报
回复
select
ua.id id,
ub.umc_login_name umcLoginName,
ua.app_cluster_company appClusterCompany,
ua.app_cluster_user appClusterUser,
ua.name clusterName,
ua.app_cluster_login_name appClusterLoginName,
ua.create_time createTimeV,
ua.create_user_id createUserId
from umc_user_base ub
right join (select distinct(ac.id),band.*, ac.name
from umc_user_banding band
left join umc_app_cluster ac on band.app_cluster_id = ac.id)
ua on ub.id = ua.umc_user_id
where ub.id = '1'


谢谢楼上的,
我这样写,为什么报 “为明确定义列”。。

怎么解决啊,
Phoenix_99 2010-03-26
  • 打赏
  • 举报
回复
select distinct(ac.id),band.*, ac.name 
from umc_user_banding band
left join umc_app_cluster ac on band.app_cluster_id = ac.id


distinct必须放在最前面
ORHCLE 2010-03-26
  • 打赏
  • 举报
回复
distinct不能这样使用

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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