select distinct * from table;
...
打开查询
while not eof do
begin
    存入数组
    数组下标+1
    Next;
end;

解决方案 »

  1.   

    原码如下,可还是不行,在combobox中还是有从复数据
    query1.Active:=false;
    query1.SQL.Clear;
    query1.SQL.Add('select distinct nd from zscz ');
    query1.Open;
    while not table2.eof do
            begin
            combobox1.Items.Add(table2.Fields[0].text);
            table2.Next;
            end;
      

  2.   

    呵呵,你的源码中table2是谁?你的DataSet不是Query1吗?提醒你检查一下,或许是粗心大意了。:-)
      

  3.   

    不太明白你的意思,是query1中就有重复的数据马?
    如果不是
    combobox1.Items.clear;
    query1.Active:=false;
    ……
    如果是
    query1.SQL.Add('select fieldName1 from zscz group by fieldName1');
      

  4.   

    在sql语句中加distinct,并且nd须为关键字段