使用 C# 代码编写 SQL 查询语句,获取符合条件的记录数量,代码如下:

string sql = $@"select count(*)
                          from '{ProductProductionRecorderTableMainName}'{production}
                          where '{ProductionData}' >= '{StartTime}' and '{ProductionData}' <= '{EndTime}' and '{ProductionCondition}' = {condition} ";
                int result = SqlConnector.ExecuteNonQuery(sql, CommandType.Text);

result 是一个数字,表示符合条件的记录数量。


原文地址: https://www.cveoy.top/t/topic/mwx3 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录