to 沈前卫:
不行。
(我用的是 M$ SQL Server 7)
================================================
用 order by 提示语法错误
select top 2 * from sysobjects order by name
minus
select top 2 * from sysobjects order by name
Server: Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near 'minus'.
================================================
不用 order by 的结果不是想要的
select top 2 * from sysobjects -- order by name
minus
select top 2 * from sysobjects -- order by name
name id xtype uid info status base_schema_ver replinfo parent_obj crdate ftcatid schema_ver stats_schema_ver type userstat sysstat indexdel refdate version deltrig instrig updtrig seltrig category cache
-------------------------------------------------------------------------------------------------------------------------------- ----------- ----- ------ ------ ----------- --------------- ----------- ----------- --------------------------- ------- ----------- ---------------- ---- -------- ------- -------- --------------------------- ----------- ----------- ----------- ----------- ----------- ----------- ------
sysobjects 1 S 1 25 -2147483645 65 0 0 1998-11-13 03:00:18.827 0 64 1 S 1 113 0 1998-11-13 03:00:18.827 0 0 0 0 0 2 0
sysindexes 2 S 1 29 -2147483643 33 0 0 1998-11-13 03:00:18.827 0 32 1 S 1 8273 0 1998-11-13 03:00:18.827 0 0 0 0 0 2 0
(2 row(s) affected)
name id xtype uid info status base_schema_ver replinfo parent_obj crdate ftcatid schema_ver stats_schema_ver type userstat sysstat indexdel refdate version deltrig instrig updtrig seltrig category cache
-------------------------------------------------------------------------------------------------------------------------------- ----------- ----- ------ ------ ----------- --------------- ----------- ----------- --------------------------- ------- ----------- ---------------- ---- -------- ------- -------- --------------------------- ----------- ----------- ----------- ----------- ----------- ----------- ------
sysobjects 1 S 1 25 -2147483645 65 0 0 1998-11-13 03:00:18.827 0 64 1 S 1 113 0 1998-11-13 03:00:18.827 0 0 0 0 0 2 0
sysindexes 2 S 1 29 -2147483643 33 0 0 1998-11-13 03:00:18.827 0 32 1 S 1 8273 0 1998-11-13 03:00:18.827 0 0 0 0 0 2 0
(2 row(s) affected)