我是oracle的新手,我遇到了问题.我有一个名为file_id的列.
当我按顺序排序时,它会对字符串进行排序
1
1
10
100
11
11
110
114
12
300
31
4200
B14
B170
B18
Run Code Online (Sandbox Code Playgroud)
编辑:我希望它以这种方式排序.
1
1
10
11
11
12
31
100
300
4200
B14
B18
B170
Run Code Online (Sandbox Code Playgroud)
以下答案非常有效.我现在遇到的其他问题......我的记录是空白的.我怎么能在最后制作空白唱片?
1
1
10
11
11
12
31
100
300
4200
BLANK
BLANK
BLANK
BLANK
BLANK
B14
B18
B170
Run Code Online (Sandbox Code Playgroud)
谢谢您的帮助.
我有一个类似于此的oracle表
表名:注意
NoteID(PK) NoteText ParentNoteID
1 x -
2 y 1
3 z 2
Run Code Online (Sandbox Code Playgroud)
在这里,我需要在notetext上面执行类似的查询,例如'%z%'这样的note.note_text,它会单独提取第三条记录.
我希望在获得第三条记录之后拉出它的父母的记录.通过查询匹配,我需要通过查看parentNoteID返回.所以第3条记录的父记录是2,父记录2是1.所以结果应该获取所有三个记录.
为了扩展这一点,如果我的like查询匹配两个子记录,显然它应该获得两者的所有父记录.
例:
NoteID(PK) NoteText ParentNoteID
1 x -
2 y 1
3 z 2
4 a -
5 b 4
6 z 5
Run Code Online (Sandbox Code Playgroud)
note.note_text like '%z%'
应拉,以上所有6条记录.
在此先感谢Eswar.