日期:2014-05-18 浏览次数:20716 次
select sum(MealNumber) as 'sum',MealName from #meal group by MealName select * from #meal where persontype = 1 order by MealDate,MealName select * from #meal where personType = 2 order by MealDate,MealName
string sql = @"select sum(MealNumber) as 'sum',MealName from #meal group by MealName select * from #meal where persontype = 1 order by MealDate,MealName select * from #meal where personType = 2 order by MealDate,MealName"; comm.commandText = sql; SqlDataReader dr = comm.ExecuteReader();