火鸟排序表 [英] Firebird sort table

查看:69
本文介绍了火鸟排序表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要对表格中插入的记录进行排序.

I need to sort inserted record in my table.

我尝试以下查询: UPDATE MyTable设置FieldN + 1 = NULL ORDER BY MyField ASC; ,但是它不起作用.

I try this query : UPDATE MyTable set FieldN+1=NULL ORDER BY MyField ASC ;, but it doesn't work.

如何对表格中所有插入的记录进行排序.

How can I sort all inserted record in my table.

当我使用IDE显示所有插入的记录时,我需要查看所有排序的记录.

When I show all inserted record with my IDE, I need to view all record sorted.

1    A                          B 

     B         =>         1     A

2    C                    2     C

推荐答案

SQL表中的记录没有内部顺序,并且是按无序集建模的.因此,没有对表中插入的记录进行排序的概念.如果要强加订单,可以在通过 ORDER BY 子句选择时进行:

Records in a SQL table have no internal order, and are modeled after unordered sets. Hence, there is no notion of sorting the inserted records in your table. If you want to impose an order, you can do that at the time you select via an ORDER BY clause:

SELECT *
FROM MyTable
ORDER BY MyField

这篇关于火鸟排序表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆