Sql = "Select Count(a1.编号) As 序号,a1.名称 from tbl部门 As a1,tbl部门 As a2"
Sql = Sql & "Where a1.编号>=a2.编号 and a1.编号<'a90' and a2.编号<'a90'"
Sql = Sql & "Group by a1.名称 Order by 1"
查询2.
sql="update tbl部门 INNER JOIN 查询1 ON tbl部门.名称 = 查询1.名称 SET tbl部门.编号 =查询1.序号"