在查询的时候就用一个distinct去掉重复值!
string addybh
declare petor cursor for //设置游标名petor
select "cpy"."ybh" //cpy是表名.ybh要列名
from "cpy"
order by "cpy"."ybh" desc; //排列顺序
ddlb_ybh.reset() //ddlb_ybh为LISEBOX名
open petor; //打开游标
fetch petor into :addybh;
do while sqlca.sqlcode=0 //填入数据,若查询成功则继续
ddlb_ybh.insertitem(addybh,1)
ddlb_ybh.text=addybh
fetch petor into :addybh;
loop
close petor; //关闭油标号游标
distinct 防在哪?/谢谢 我新手