select a from table1 order by ASCII(a) asc--如a列的字符为1位时
select char(78)--如果是数字 select ASCII('N')--如果是字符declare @ta table (id int) insert @ta select 78 union select 101 select * from @ta order by char(id) asc(2 行受影响) id ----------- 101 78(2 行受影响)
select a from table1 where col1='06' order by ASCII(usercode) asc; 好像不行啊
declare @ta table (id int) insert @ta select 78 union select 101 select char(id) from @ta order by char(id) asc --以下为转换后的字符 (2 行受影响)---- e N(2 行受影响)
select char(id) from @ta order by char(id) asc 这个行了
select语句应该怎样写?
select ASCII('N')--如果是字符declare @ta table (id int)
insert @ta select 78 union select 101
select * from @ta order by char(id) asc(2 行受影响)
id
-----------
101
78(2 行受影响)
好像不行啊
declare @ta table (id int)
insert @ta select 78 union select 101
select char(id) from @ta order by char(id) asc
--以下为转换后的字符
(2 行受影响)----
e
N(2 行受影响)
这个行了
//因为a开头字母都是英文字符,所有没有影响
right(字段,len(字段)-1)--排除第一个字符
不知道为什么
找不到*LIBL类型*N中的ASCII