下拉列表框获得数据库中数据,如何去除重复的值
string ls_select
long ll_select_num, ll_cnt
DataStore lds_select
lds_select = create datastore
lds_select.DataObject = "d_card_class"
lds_select.SetTransObject(sqlca)
ll_select_num = lds_select.Retrieve()
tab_1.tabpage_1.ddlb_cardclass.text = "全部卡类型"
for ll_cnt = 1 to ll_select_num
ls_select = string(lds_select.object.card_class[ll_cnt])
tab_1.tabpage_1.ddlb_cardclass.additem(ls_select)
next
tab_1.tabpage_1.dw_select.SetTransObject(sqlca)
tab_1.tabpage_1.dw_select.Retrieve()
在选择卡类型添加到ddlb中有重复的,望各位指点一下如何去掉重复的
[解决办法]
d_card_class 中的select语句加上distinct,,
[解决办法]
1楼说的没错。
[解决办法]
嗯,就是distinct
[解决办法]