日期:2014-05-18 浏览次数:20731 次
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();