for i:=0 to adotable1.RecordCount-1 do
begin
dbcombobox1.Items.Add(adotable1.Fields.Fields[1].asstring);
adotable1.Next;如何将dbcombobox1的下拉列表相同的项目删除掉?
谢谢~~!
begin
dbcombobox1.Items.Add(adotable1.Fields.Fields[1].asstring);
adotable1.Next;如何将dbcombobox1的下拉列表相同的项目删除掉?
谢谢~~!
var
i,j:integer;
begin
for i:=0 to self.combobox1.items.count-1 do
begin
for j:=i+1 to self.combobox1.items.count- 1 do
begin
if (self.combobox1.items[j]=self.combobox1.items[i]) then
self.combobox1.items.delete(j);
end;
end;
end;
在SQL里使用distinct效率高点吧.你这样搞完全是擦屁股的做法,困了,明天再来看。
select 不重复字段名 from table group by 不重得字段名