查询单个值主要用于对成绩最低分,最高分,学生总数,学生性别等信息的统计 在查询单个值的时候用到了ExecuteScalar方法,连接以及语句方面,以及思路和对数据的增删改差不多 下面请看一段代码: string s = "server=.;database=SampleDb;Integrated Security=True"; SqlConnection c = new SqlConnection(s); c.Open(); SqlCommand command = new SqlCo…
本周内: select * from wap_content where week(created_at) = week(now) 查询一天: select * from table where to_days(column_time) = to_days(now());select * from table where date(column_time) = curdate(); 查询7天: select * from table where DATE_SUB(CURDATE(), INTER…