SELECT DEBTOR_ID,
LEFT(NAME1, 30) AS NAME1,
SSN1,
DOB1,
DL1,
PRIORITY,
NEXT_CONTACT_DATE,
NEXT_CONTACT_TIME,
STATUS_CODE,
SCORE,
ASSIGN_ID
FROM DM.DBTR
WHERE STATUS_CODE = 110
AND ASSIGN_ID = '001'
ORDER BY DBTR.DEBTOR_id
答案 0 :(得分:1)
如果您的意思是按降序排列,只需使用
即可ORDER BY DBTR.DEBTOR_id DESC
答案 1 :(得分:0)
只需使用desc
关键字降序排序您的数据:
SELECT DEBTOR_ID, LEFT(NAME1, 30) AS NAME1, SSN1, DOB1, DL1,
PRIORITY,
NEXT_CONTACT_DATE, NEXT_CONTACT_TIME, STATUS_CODE, SCORE,
ASSIGN_ID
FROM DM.DBTR
WHERE STATUS_CODE = 110 AND ASSIGN_ID = '001'
ORDER BY DBTR.DEBTOR_id DESC
答案 2 :(得分:0)
我猜你在谈论ASSIGN_ID?如果是这样,你可以使用IDENT_CURRENT。所以它会像
IDENT_CURRENT('ASSIGN')
其中ASSIGN是与ASSIGN_ID
相关的表名你也可以
ORDER BY ASSIGN_ID DESC