【问题标题】:Alias uppercasing with Dapper使用 Dapper 大写的别名
【发布时间】:2014-11-04 17:24:51
【问题描述】:

我对@9​​87654321@(最新的 odp.net.managed 包)执行了以下查询。

const string sql = @"select MyCol, count(1) Count from T group by MyCol";

动态[] 行 = DB.Query(sql).ToArray();

它运行良好,但是生成的动态具有名为 COUNT 的第二个属性。 为什么?我该如何解决?

【问题讨论】:

    标签: .net oracle dapper


    【解决方案1】:

    用双引号将您的别名括起来,oracle 会保留您指定的任何大小写。

    const string sql = @"select MyCol, count(1) ""Count"" from T group by MyCol";
    

    【讨论】:

    • 不应该是 "" 用于在逐字 (@) 字符串中转义双引号吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多