解决 Oracle column ambiguously defined 的问题
1、案例1:
select * from(
select aa2.workorder,aa2.*,bb.* from
(select distinct t.workorder,t.client,t.product_type,t.batch_qty from table t )aa2
right join
(select t.workorder,count(t.workorder) as qianshuliang from table t
group by t.workorder )bb on (aa2.workorder = bb.workorder)
)a1
right join (select t.workorder,count(t.workorder) as benshuliang from table t group by t.workorder
)b1 on (a1.workorder=b1.workorder)
出现错误
2、案例2:
select * from(
select aa2.workorder,aa2.client,aa2.product_type,bb.qianshuliang from
(select distinct t.workorder,t.client,t.product_type,t.batch_qty from table t )aa2
right join
(select t.workorder,count(t.workorder) as qianshuliang from table t
group by t.workorder )bb on (aa2.workorder = bb.workorder)
)a1
right join (select t.workorder,count(t.workorder) as benshuliang from table t group by t.workorder
)b1 on (a1.workorder=b1.workorder)
3、原因:
在取多个列时,需要给列一个别名,如上文否则出现
Oracle column ambiguously defined(列定义不明确的问题)
解决 Oracle column ambiguously defined 的问题相关推荐
- Oracle “column ambiguously defined ” 错误
在Oracle中执行查询,有时候会报错"column ambiguously defined ",中文意思是字段定义模糊.报错如下图: 这个错误通常是由于FROM的两个表中都有某个 ...
- oracle column ambiguously defined
[color=red]问题:[/color]数据查询出现 column ambiguously defined 异常 [color=red]原因:[/color]当前sql语句,存在多表查询,查询的结 ...
- Oracle报错“ORA-00918:column ambiguously defined”
一.现象描述 ORA-00918:column ambiguously defined,从字面上理解就是:未明确定义的列. 当出现这种SQL语句的时候就会出现:select t.* from (sel ...
- Oracle 查询SQL语句报 ORA-00918: column ambiguously defined(Navicat中)
原有的SQL语句是: SELECT* FROM(SELECTi.ID,i.NAME,i.code,i.num,i.state,i.unit,i.TYPE,i.addtime,i.TIME,i.user ...
- ORA-00918: column ambiguously defined解决之道
最近做一个项目,经常需要用到多表查询(Hibernate),通过需要分页等,于是经常会碰到 ORA-00918: column ambiguously defined错误. 该报错翻译过来:某一列定义 ...
- column ambiguously defined oracle数据库分页语句查询中select嵌套时出错
column ambiguously defined &oracle数据库分页语句查询中select嵌套时出错 转载于 [ lev草梦的博客](http://blog.sina.com.cn/ ...
- oracle 报错 column ambiguously defined
column ambiguously defined ORA-00918: column ambiguously defined java.sql.SQLException: ORA-00918: c ...
- oracle: column ambiguously defined
分页查询 column ambiguously defined 未明确定义的列 select * from (select abc.*, rownum m from (se ...
- oracle中defined,Oracle:专栏定义(Oracle: column ambigously defined)
Oracle:专栏定义(Oracle: column ambigously defined) 我收到以下错误. 据我所知,所有列都是由表名定义的,所以我不明白为什么我从Oracle数据库中得到这个错误 ...
最新文章
- python的优点-Python语言的优势有哪些?
- thinkphp scws mysql_thinkphp buildHtml 函数实现网站静态化
- Last Theorem CodeForces - 1325F(dfs树找最大环+思维)
- 计算机网络之数据链路层:6、后退N帧协议(GBN)
- 苏宁易购发全员信:双十一销售目标全面完成 力争11月EBITDA转正
- 清华学霸直博简历:CPU、操作系统、编译器全自主写
- Android控件——TextView,EditText
- Windows下AndroidStudio 中使用Git(AndroidStudio项目于GitHub关联)
- 生产者消费者模型(自己上锁与阻塞队列两版本)
- python与c语言数据交互,python与c语言交互---学习012
- Padavan启用ipv6并允许公网访问内网
- 超级详细的iptables介绍
- html 引入 icon 图标
- select XX.nextval from dual
- Android有那些好的进阶书籍呢
- 2016山东教师教育网- 一师一优课
- 天翼云linux版本,天翼云Linux主机操作
- 23、账号与权限管理
- linux 查明文密码,登录页面密码支持明文查看
- 操作系统实验报告——实验一:熟悉Linux命令及进程管理