【问题标题】:R -- RJDBC not able to rename column in SQL selectR -- RJDBC 无法重命名 SQL 选择中的列
【发布时间】:2018-05-03 23:20:06
【问题描述】:

使用 RJDBC 库似乎无法重命名 SQL 选择中的列。 有人知道它的解决方法吗?我发现这个 useJDBC4ColumnNameAndLabelSemantics=true 用于 Db2,但不确定它是否可以在 R 中使用。

Select
a.customer,
b.customer as main_customer,  <-- returns as customer not main_customer
b.customer_email
from customer a,
     main_customer b
where a.customer_id = b.customer_id

【问题讨论】:

    标签: r db2 rename rjdbc


    【解决方案1】:

    找到这个 -> Column alias querying IBM DB2 using Oracle SQL developer

    例如,在我的例子中,数据库名称是 SAMPLE,如果我希望应用程序显示查询中的相关 ID 名称,那么我使用数据库名称:

    SAMPLE:useJDBC4ColumnNameAndLabelSemantics=No;
    

    【讨论】:

      猜你喜欢
      • 2011-12-03
      • 2021-12-16
      • 2019-05-07
      • 2018-04-24
      • 1970-01-01
      • 2019-08-28
      • 1970-01-01
      • 2022-11-03
      • 1970-01-01
      相关资源
      最近更新 更多