不知道为什么 group by 之后数据少一个,很奇怪。
id color_class
1 aa
2 bb
3 cc
string Sql2 = "select color_class from color_pf group by color_class";
OleDbCommand cmd2 = new OleDbCommand(Sql2, conn);
OleDbDataReader sdr2 = cmd2.ExecuteReader();
sdr2.Read();
while (sdr2.Read())//这是一行一行的读取查询出来的数据集
{
gtxt = gtxt + sdr2["color_class"];
}
结果
gtxt = bbcc
少了 aa
不知道什么原因,求解救,谢谢。