-- 作者:建筑人生
-- 发布时间:2022/7/7 17:10:00
-- [求助] 数据行数
此主题相关图片如下:013.png
此主题相关图片如下:005.png
Dim cmd As New SQLCommand cmd.CommandText = "S ELECT DISTINCT 科目表_一级 as 一级科目,科目表_二级 as 二级科目,科目表_三级 as 三级科目,科目表_四级 as 四级科目,科目表_五级 as 五级科目,科目表_借方 as 借方,科目表_贷方 as 贷方 From{流水账} union S ELECT DISTINCT 对方科目_一级 as 一级科目,对方科目_二级 as 二级科目,对方科目_三级 as 三级科目,对方科目_四级 as 四级科目,对方科目_五级 as 五级科目,对方科目_借方 as 借方,对方科目_贷方 as 贷方 From{流水账}" Dim dt As DataTable = cmd.ExecuteReader()
Dim i As Integer = dt.DataRows.Count
Output.Show(i)
数据库有5326行,为什么只计算5229行
[此贴子已经被作者于2022/7/7 17:17:44编辑过]
|
-- 作者:建筑人生
-- 发布时间:2022/7/7 17:41:00
--
以下是引用有点蓝在2022/7/7 17:18:00的发言: 5326是主键的最大值,不表示有5326行。主键不一定是连续的
Dim cmd As New SQLCommand cmd.C cmd.CommandText = "S ELECT 科目表_一级 as 一级科目,科目表_二级 as 二级科目,科目表_三级 as 三级科目,科目表_四级 as 四级科目,科目表_五级 as 五级科目,科目表_借方 as 借方,科目表_贷方 as 贷方 From{流水账} union S ELECT 对方科目_一级 as 一级科目,对方科目_二级 as 二级科目,对方科目_三级 as 三级科目,对方科目_四级 as 四级科目,对方科目_五级 as 五级科目,对方科目_借方 as 借方,对方科目_贷方 as 贷方 From{流水账}" Dim dt As DataTable = cmd.ExecuteReader()
此主题相关图片如下:103.png
[此贴子已经被作者于2022/7/7 17:41:45编辑过]
|