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 with a tedious query老板的无理要求!(希望熟悉Oracle的朋友指点)使用MS Access问题Help!!! Need TREC-4 or TREC-5 data CDAW and Shuke Re: Can I...请推荐sybase的书sql question[求助] 数据库的工作--现场面试SQL Server查询页面处理问题明白Re: AW and Shuke Re: Can I...secure website using oracle[转载] Recommend a platform and designSybase Server setting questionsdatabase overflow请教考MCAD里SQL的经验SQL操作命令一问[转载] Help: how to modify DBF file by C++[转载] 还有个技术问题,请大拿们指导[转载] java数据库读取错误,请教如何获得把Oracle9i从9.2.0.1升级到9.2.0.4的补丁?