再说明一下id是number型,carpath是varchar2型
解决方案 »
- Oracle用exp导出数据是的问题,在线急等啊……
- 求助~~数据库查询中,如何删除关键字只出现过一次的数据项~
- ORA-01001: invalid cursor怪异错误求解
- 请问如下两条SQL语句为什么执行时间差这么多?
- logmnr 解析归档文件的问题
- 急,我的系统是WIN2003SERVER (NTFS),手中的oracle9i数据库安装盘是64位的,安装时提示没有WIN32文件可执行
- oracle行列转换问题,不是通常模式的转换。
- 就剩下30分了,一个很急的问题
- 安装8.1.7后,不能新建数据库的问题
- mp3如何存储到数据库中?
- oracle 未能正常加載
- 高难度问题,从package调用oracle的java机能来执行unix上的shell时发生的错误
from a
order by carpath ||','||to_char(id) desc
楼主的语句中concat连接三个字符,这样就会报错
如果要使用concat,你可以这样:
select concat(concat(catpath,','),id) as path from A order by path desc;
至于id,你可以不用做to_char的处理,这里直接就转换了关于concat的详细解释见下面:
CONCAT returns char1 concatenated with char2. Both char1 and char2 can be any of the datatypes CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. The string returned is in the same character set as char1. Its datatype depends on the datatypes of the arguments.In concatenations of two different datatypes, Oracle returns the datatype that results in a lossless conversion. Therefore, if one of the arguments is a LOB, then the returned value is a LOB. If one of the arguments is a national datatype, then the returned value is a national datatype. For example:CONCAT(CLOB, NCLOB) returns NCLOB
CONCAT(NCLOB, NCHAR) returns NCLOB
CONCAT(NCLOB, CHAR) returns NCLOB
CONCAT(NCHAR, CLOB) returns NCLOB