GoLang 读取SQL 数据库的问题

LZC_Golang · · 1589 次点击
//rows, err := db.Query("SELECT JSJID, RTRIM(cast(OrderNumber as CHAR(18))) AS OrderNumber, State, cast(DepositAmount as CHAR(20)) AS DepositAmount, Remark, CreateTime FROM [dbo].[_DepositLog] WHERE DATEDIFF(DAY,CreateTime,GETDATE()) = 6 AND [State] > 90 ORDER BY CreateTime DESC") rows, err := db.Query("SELECT JSJID, RTRIM(cast(OrderNumber as CHAR(18))) AS OrderNumber, State, RTRIM(cast(DepositAmount as CHAR(20))) AS DepositAmount, Remark, CreateTime FROM [dbo].[_DepositLog] WHERE DATEDIFF(DAY,CreateTime,GETDATE()) = 6 AND [State] > 90 ORDER BY CreateTime DESC") 上面的SQL语句是没有问题的,下面的SQL 执行的结果就会出现上面的如图上面的问题,诡异的是 数据库中的这两条数据是一样的;不知道为什么查询出来的结果是有问题的。
#6
更多评论
图上面的字太小了。
#1
我重新发布一下,你关注一下
#2