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
相关阅读
help about oracle 8.17index loss after replicationCreate的时候有没有简单的方法?(oracle 8)怎么样列出创建的所有表呀?哪位大虾精通FILEMAKER?如何定义多个ATTRIBUTES为PRIMARY KEY?Help: Database managementORACLE+VC产生巨大临时文件SQL server vs. DB 2[转载] How to use Visual Basic in MS WordWhat does "EIB" stands for? Thanks!JDBC: How to get Identity after inserturgent: help on perl/ personal web serverQuestions about building a database(Maybe ACCESS?)Re: urgent! which odbc lib file need use when use the oracle8i&odbc onhi,where can i find sql source code online?embedded sql 问题Re: how to improve the performance of Oracle Insert operation?如何分析Stored Procedure运行时间过长?Help!--How to transfer string to Date(mm-dd-yyyy hh24:mi:ss) in Access?what's the ddl to delete a db?