先 select DISTINCT A from table1 再ComboBox1.item.add
ComboBox1.clear; qry.close; qry.Sql.clear; qry.Sql.Add('select DISTINCT A from table1'); qry.open; qry.first; while not Qry.EOF do begin ComboBox1.item.add(qry.FieldByname('A').AsString); qry.next; end;
再ComboBox1.item.add
qry.close;
qry.Sql.clear;
qry.Sql.Add('select DISTINCT A from table1');
qry.open;
qry.first;
while not Qry.EOF do
begin
ComboBox1.item.add(qry.FieldByname('A').AsString);
qry.next;
end;