本文介绍了我没有得到asc命令(我想要val_name asc命令,但是我得到了dis)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

public DataSet GetContractTerm(string prodKey, int propLinkID, OleDbConnection conn)
        {
            string sQuery;
            string Prod_Friendly_Name = string.Empty;
   sQuery = "select distinct VAL_ID, VAL_NAME from PPSR_OWNER.ppsr_q2o_att_data_v  where attribute_name = 'CONTRACT TERM'   ORDER BY VAL_NAME ASC";           
 DataSet dsContractTerm = new DataSet();

            try
            {
                dsContractTerm = CCBusiness.Utility.OracleHelperUtility.ExecuteDataset(conn, sQuery);
            }
            catch (Exception e)
            {
                CCBusiness.Utility.OracleHelperUtility.LogPPSRError(System.Web.HttpContext.Current, e);
                throw e;
            }
            return dsContractTerm;

}

private string GetContractName(DataSet ds, string contractID)
        {
            string contractname = string.Empty;

            for (int contract = 0; contract < ds.Tables[0].Rows.Count; contract++)
            {
                if (contractID == ds.Tables[0].Rows[contract]["VAL_ID"].ToString())
                {
                    contractname = ds.Tables[0].Rows[contract]["VAL_NAME"].ToString();
                    break;
                }

            }
            return contractname;
        }


获得结果
1
10
11
12
13
14
15
16
17
18
19
2
20
21
22
23
3
30
31
预期结果
1
2
3
4
5
6
7
8
9
10
11


Gettingresult
1
10
11
12
13
14
15
16
17
18
19
2
20
21
22
23
3
30
31
Expected result
1
2
3
4
5
6
7
8
9
10
11

推荐答案

ORDER BY CAST(VAL_NAME AS NUMBER)



谢谢,
Imdadhusen



Thanks,
Imdadhusen



select distinct VAL_ID, VAL_NAME from PPSR_OWNER.ppsr_q2o_att_data_v  where attribute_name = ''CONTRACT TERM''  ORDER BY Convert(Decimal,VAL_NAME) ASC


这篇关于我没有得到asc命令(我想要val_name asc命令,但是我得到了dis)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 21:24