因此,当我运行此查询时,我得到6个数据结果
Select Title
From products.features
where productid = '172'
以下是数据:
我只想在结果中显示第二行..
UL认证94V-O,黑色,10%玻璃填充6尼龙,符合ASTM D4066 PA210G11
答案 0 :(得分:2)
我假设您正在尝试按标题订购
select Top 1 Title
from (
Select Top 2 Title
From products.features
where productid = '172'
order by Title asc
) a
order by Title desc
你遗漏的是Order By。如果您没有订单......您的结果将无法保证每次运行。随机排序。
答案 1 :(得分:0)
with cte as
(
Select TOP 5 Title, Title_Row = ROW_NUMBER() OVER (ORDER BY Title asc)
From products.features
Where productid = '172'
)
Select *
From cte
Where Title_Row = 2
Order by Title
编辑,按标题添加顺序。