n*6
4 楼
我以前遇到过类似的问题,不敢用select top。高人指点一下select top如何产生?
msdn说top在order by时按顺序产生.高人解释一下。
If the query includes an ORDER BY clause, the first expression rows, or expression percent of rows, ordered by the ORDER BY clause are returned. If the query has no ORDER BY clause, the order of the rows is arbitrary.
MSDN说top在insert, update时是随机的。
The rows referenced in the TOP expression used with INSERT, UPDATE, MERGE,
or DELETE are not arranged in any order. TOP n returns n random rows.
http://msdn.microsoft.com/e
【在 B*****g 的大作中提到】
: oracle:
: SELECT (SELECT col_b
: FROM test
: WHERE col_a = 4
: AND rownum = 1) col_b
: FROM DUAL
: sql server
: SELECT (SELECT TOP 1 col_b
: FROM test
: WHERE col_a = 4) col_b
msdn说top在order by时按顺序产生.高人解释一下。
If the query includes an ORDER BY clause, the first expression rows, or expression percent of rows, ordered by the ORDER BY clause are returned. If the query has no ORDER BY clause, the order of the rows is arbitrary.
MSDN说top在insert, update时是随机的。
The rows referenced in the TOP expression used with INSERT, UPDATE, MERGE,
or DELETE are not arranged in any order. TOP n returns n random rows.
http://msdn.microsoft.com/e
【在 B*****g 的大作中提到】
: oracle:
: SELECT (SELECT col_b
: FROM test
: WHERE col_a = 4
: AND rownum = 1) col_b
: FROM DUAL
: sql server
: SELECT (SELECT TOP 1 col_b
: FROM test
: WHERE col_a = 4) col_b
B*g
15 楼
千千姐是谁?
c*e
16 楼
你没有看错,就是她,哈哈哈
h*n
18 楼
expression percent of rows, ordered by the ORDER BY clause are returned. If
the query has no ORDER BY clause, the order of the rows is arbitrary.
你觉得insert/update的时候顺序重要吗?order by的时候呢?
【在 n********6 的大作中提到】
: 我以前遇到过类似的问题,不敢用select top。高人指点一下select top如何产生?
: msdn说top在order by时按顺序产生.高人解释一下。
: If the query includes an ORDER BY clause, the first expression rows, or expression percent of rows, ordered by the ORDER BY clause are returned. If the query has no ORDER BY clause, the order of the rows is arbitrary.
: MSDN说top在insert, update时是随机的。
: The rows referenced in the TOP expression used with INSERT, UPDATE, MERGE,
: or DELETE are not arranged in any order. TOP n returns n random rows.
: http://msdn.microsoft.com/e
相关阅读
Is that possible for Applet to access the Oracle?如何做到?不可不看Why did BM/BF not mark #344(by pigbaby)?Re: Make your own dynamic page todayRe: ~{K-SP~}Java~{;r~}Oracle~{5D6>UP~}?[转载] how to set up the classpath?This board seems to be closableRe: 请教C++制作数据库的问题(continue)what about oracle,repository&service?sosPerl DBI & DBD在问一个问题who used oracle 8i?Comparing different commercial available DBMS?[转载] LDAP + SQL最早的debase(拼法正确否)有没有unix下的版本呢?A question请教C++制作数据库的问题Where can I download Oracle for Linux?第三课 对象、属性、事件、方法