Oracle统计采用别名出错(user.table.column, table.column 或列说明无效)

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

蕃薯耀 2015年12月29日 15:09:00 星期二

http://fanshuyao.iteye.com/

一、错误

java.sql.SQLException: ORA-01747: user.table.column, table.column 或列说明无效

使用的sql如下

select count(u.*) from T_USER u
inner join T_ORG_USER_R r on r.USER_ID = u.USER_ID and r.ENABLE_FLAG = 'Y'
where u.ENABLE_FLAG = 'Y' and r.ORG_ID = 23959;

二、错误原因

在关联查询中,Oracle不能使用count(u.*)这样的别名,不过在SQL中是可以的。

三、解决

直接使用 count(*)

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

蕃薯耀 2015年12月29日 15:09:00 星期二

http://fanshuyao.iteye.com/

user.table.column, table.column 或列说明无效的更多相关文章

  1. ORA-01747: user.table.column, table.column 或列说明无效

    Oracle.DataAccess.Client.OracleException ORA-01747: user.table.column, table.column 或列说明无效 原因1: 查了一下 ...

  2. 关于“ORA-01747: user.table.column, table.column 或列说明无效”的报错。

    今天在工程中遇到“ORA-01747: user.table.column, table.column 或列说明无效”的报错情况,查了一下是由于数据库列名起的不好引起的,名字用到了数据库的关键字.

  3. “ORA-01747: user.table.column, table.column 或列说明无效” 的解决方案

    此问题的原因是因为表的列名称使用了Oracle声明的关键字,列名起的不好引起的. 如果列很多,又不好确定是哪个列名使用了关键字,以下建议可供参考: select * from v$reserved_w ...

  4. SQLAlchemy Table(表)类方式 - Table类和Column类

    Table 构造方法 Table(name, metadata[, *column_list][, **kwargs]) 参数说明: name 表名 metadata 元数据对象 column_lis ...

  5. SpringBoot+MyBatis中自动根据@Table注解和@Column注解生成增删改查逻辑

    习惯使用jpa操作对象的方式,现在用mybatis有点不习惯. 其实是懒得写SQL,增删改查那么简单的事情你帮我做了呗,mybatis:NO. 没办法,自己搞喽! 这里主要是实现了通过代码自动生成my ...

  6. dashDB - Creating a table with CLOB column type

    In order to create a table with clob column type, the table has to be created with "ORGANIZE BY ...

  7. [转]jQuery: get table column/row index remove table column (by column number)

    本文转自:http://www.xinotes.org/notes/note/1087/ <!DOCTYPE html><html><head> <title ...

  8. 修改TABLE中的Column的属性

    删除主键名 这个主键名并不是列名,而是主键约束的名字,如果当时设置主键约束时没有制定约束的名字 设置主键的语句:ALTER TABLE P add constraint pk PRIMARY KEY ...

  9. sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) Cannot add a NOT NULL column with default value NULL [SQL: u'ALTER TABLE address_scopes ADD COLUMN ip_version INTEGER NOT NULL']

    root@hett-virtual-machine:~# su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neu ...

随机推荐

  1. [topcoder]IncreasingSubsequences

    http://community.topcoder.com/stat?c=problem_statement&pm=7753&rd=10672 http://community.top ...

  2. 安装Chive提示CDbConnection failed to open the DB connection.

    最近初学PHP,看到Chive这个好玩的数据库管理工具,在登录时遇到这样的错误提示信息: CDbConnection failed to open the DB connection. 我的PHP版本 ...

  3. Lua table pair和ipair区别

    官方描述: ipairs (t) Returns three values: an iterator function, the table t, and 0, so that the constru ...

  4. 利用if else咱们结婚吧

    class Program    {        static void Main(string[] args)        {            while (true)           ...

  5. WC2015 滚粗记

    Day 0 和南师附中诸人去杭州,想到这是第三次去杭州有点感动 想到noi还要在杭州,简直…… 火车站接送好评如潮 ym大学军,到学军领资料然后到浙大宿舍安顿,noi的书包还是挺不错的 看起来宿舍还可 ...

  6. 【转】VirtualBox下Ubuntu共享文件

    原文网址:http://www.it165.net/os/html/201209/3435.html 今天想从主机上拷贝几个文件到 VirtualBox 的 Ubuntu 下, 但是, Virtual ...

  7. 【Android 复习】:第02期:引导界面(二)使用ViewPager实现欢迎引导页面

    一.实现的效果图 也许是养成了这样一个习惯,每次看别人的代码前,必须要先看实现的效果图达到了一个什么样的效果,是不是跟自己想要实现的效果类似,有图才有真相嘛,呵呵.           二.编码前的准 ...

  8. Never use GetDate() when comparing date timesoffsets, use SYSDATETIMEOFFSET()

    -- my current uk time is 2014-01-09 10:43:00 +0 ) = '2014-01-09 18:43:00 +08:00'; ) = '2014-01-09 02 ...

  9. HDOJ --- 1160

    FatMouse's Speed Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) ...

  10. 昂贵的聘礼--POJ1062

    昂贵的聘礼 Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 20000/10000K (Java/Other) Total Submiss ...