SQL Server 2000查询 [英] SQL Server 2000 Query

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

问题描述

我有两张桌子,我想选择1-50条记录,我得到了我想要的东西,

和我使用这个查询..



SELECT TOP 50 tbl_Standard。*

FROM tbl_Standard INNER JOIN

tbl_Mom_Type ON

tbl_Standard.Standard_No = tbl_Mom_Type.Standard_No

ORDER BY tbl_Mom_Type.Date_of_Meeting DESC





接下来我要选择50-100条记录。

我使用此查询。



SELECT TOP 50 tbl_Standard。*

FROM(SELECT TOP 100 tbl_Standard。*

FROM tbl_Standard INNER JOIN

tbl_Mom_Type ON

tbl_Standard.Standard_No = tbl_Mom_Type.Standard_No)

tbl_Standard INNER JOIN

tbl_Mom_Type ON

tbl_Standard.Standard_No = tbl_Mom_Type.Standard_No

ORDER BY tbl_Mom_Type.Date_of_Meeting DESC



但它没有显示记录我希望。

提前谢谢..

I have two tables and i want to select 1-50 records and i get what i want,
and im using this query..

SELECT TOP 50 tbl_Standard.*
FROM tbl_Standard INNER JOIN
tbl_Mom_Type ON
tbl_Standard.Standard_No = tbl_Mom_Type.Standard_No
ORDER BY tbl_Mom_Type.Date_of_Meeting DESC


in next i want to select 50-100 records.
and i use this query.

SELECT TOP 50 tbl_Standard.*
FROM (SELECT TOP 100 tbl_Standard.*
FROM tbl_Standard INNER JOIN
tbl_Mom_Type ON
tbl_Standard.Standard_No = tbl_Mom_Type.Standard_No)
tbl_Standard INNER JOIN
tbl_Mom_Type ON
tbl_Standard.Standard_No = tbl_Mom_Type.Standard_No
ORDER BY tbl_Mom_Type.Date_of_Meeting DESC

But it did not display the records i want.
Thanks in advance..

推荐答案

尝试在子查询中使用with。希望它能解决你的问题。
Try putting the order by with in the subquery as well. hope it resolves your issue.


你好,



见这个 link [ ^ ]供您参考。

希望这个帮助你一点。



问候,

RK
Hi,

See this link [^]for your reference.
Hope this helps you a bit.

Regards,
RK


这篇关于SQL Server 2000查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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