zoukankan      html  css  js  c++  java
  • ORA-00918:未明确定义列

    报错如下:

    经过一番排查搜索,发现问题出现在Mapper.xml中,问题的原因是三表联合查询的过程中,有些表的字段名称重复,然后由于你没有指定是哪个表的字段,所以它迷路了,对,它迷惑了,它不知道是哪个表的字段,所以报这个错。

    举个例子:

    A表:student  字段 id,name,age

    B表:user      字段uid , name

    C表:info       字段oid,level

    错误语句:由于name字段AB表中一样,所以报错。而id,age虽然没有指定,但是在三表中却是唯一的字段名称,不重复,所以没问题。

    select id,name,age from student a,user b,info c where a.id=b.uid and a.id =oid

    正确语句:

    select id,a.name,age from student a,user b,info c where a.id=b.uid and a.id =oid
  • 相关阅读:
    UILabel 详解
    didMoveToSuperView 引发的思考
    Source
    设计模式
    Code ReView
    UIApearance
    UINavigationBar
    initWithNibName与viewDidLoad的执行关系以及顺序
    bLock 回调 就是这么简单!
    程序语言小记
  • 原文地址:https://www.cnblogs.com/wanlige/p/14543113.html
Copyright © 2011-2022 走看看