【问题标题】:c# oracle max sort时间:2019-01-10 标签:c#oraclemaxsort
【发布时间】:2016-06-25 12:54:43
【问题描述】:

请我需要帮助伙计们,我正在尝试通过 c# 连接为 oracle 服务器从表中选择一些日期,我只想获取我的代码中包含最大 last_update_date 的行

ocom.commandtext("@Select status,last_update_Date,trans_number
from pas.transaction
where last_update_Date in(select(last_update_Date) 
           from pas.transaction  
           where msisdn in("+mdc_line_M+") );

但它返回任何人都无法帮助,因为我从 2 天前开始尝试

【问题讨论】:

  • ocom.commandtext("@Select status,last_update_Date,trans_number from pas.transaction where last_update_Date in(select(last_update_Date) from pas.transaction where msisdn in("+mdc_line_M+") );

标签: c# sql oracle


【解决方案1】:

你应该使用 max(last_update_Date)

ocom.commandtext("@Select status,last_update_Date,trans_number
from pas.transaction
where last_update_Date in (
        select max(last_update_Date) 
       from pas.transaction  
       where msisdn in("+mdc_line_M+") 
);"

【讨论】:

  • 也失败了请大家帮忙
  • 什么意思..“也失败了”..你有错误吗? ..或者你得到错误的..结果..?使用一组适当的示例数据更新您的问题,以进行正确的评估。
  • 现在我有一个错误,什么都没有回来,第 130 行的错误在哪里 last_update_Date in ( select max(last_update_Date) from pas.transaction where msisdn in("+mdc_line_M+") );"
  • 谢谢你解决了我所做的所有事情
  • 好吧……visual studio 有时会产生这样的问题……干得好
猜你喜欢
  • 2012-09-18
  • 2015-04-29
  • 1970-01-01
  • 1970-01-01
  • 2015-09-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多