部分排序数据库字段
我需要对包含一些名称、NULL 和一些空白记录的字段“名称”进行排序。不知何故,我需要通过在顶部按字母顺序排列所有名称来对它们进行排序,之后所有包含 NULL 的行都应该出现,之后所有包含空白的行都应该出现。例如,我的表是
id Name
1 NULL
2 NULL
3
4
5 Mobile
6 Apparel
7 Shoes
所以结果应该是这样的
6 Apparel
5 Mobile
7 Shoes
1 NULL
2 NULL
3
4
这种格式可以有数千行,所以我不知道有多少空行和空白行。上面的例子只是一个示例。
I need to sort a field "name" of that contains some name, NULL and few blank records. Somehow i need to sort them by arranging all the name in alphabetical sort order at the top and after that all rows containing NULL should come and after that all rows containing blank should come. For example my table is
id Name
1 NULL
2 NULL
3
4
5 Mobile
6 Apparel
7 Shoes
So the result should be like
6 Apparel
5 Mobile
7 Shoes
1 NULL
2 NULL
3
4
There can be thousand of rows in this format so i don't know how many null as well as blank rows are there. The above example is just a sample.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
或者没有子选择:
Or without subselect: