简单的Sql数据分页问题.。
高手们帮我看看.。下面几句代码?selectPI_PSid,OM_name,PS_carNumber,PI_price,TTI_infoName,PS_pho,PS_sh...
高手们帮我看看.。下面几句代码?
select PI_PSid,OM_name,PS_carNumber,PI_price,TTI_infoName,PS_pho,PS_shopingTime,PS_EedTime,PS_remark
from (select row_number() over(order by PI_id asc)as '编号',*
from dbo.ParkInfo as PIF inner join dbo.ParkSell as PS on(PS.PS_id=PIF.PI_PSid)
inner join dbo.OperationMessage as OM on(PS.PS_OMid=OM.OM_id)
inner join dbo.TypeTableInfo TTI on(TTI.TTI_id=PIF.PI_TinfoId)) as DB
这样我为什么不能把 '编号'这一列不能显示出来.。
把所有字段设为 * 它就可以了显示 '编号'这个列出来了..
select * from (select row_number() over(order by PI_id asc)as '编号',*
from dbo.ParkInfo as PIF inner join dbo.ParkSell as PS on(PS.PS_id=PIF.PI_PSid)
inner join dbo.OperationMessage as OM on(PS.PS_OMid=OM.OM_id)
inner join dbo.TypeTableInfo TTI on(TTI.TTI_id=PIF.PI_TinfoId)) as DB
请问这是为什么.。? 展开
select PI_PSid,OM_name,PS_carNumber,PI_price,TTI_infoName,PS_pho,PS_shopingTime,PS_EedTime,PS_remark
from (select row_number() over(order by PI_id asc)as '编号',*
from dbo.ParkInfo as PIF inner join dbo.ParkSell as PS on(PS.PS_id=PIF.PI_PSid)
inner join dbo.OperationMessage as OM on(PS.PS_OMid=OM.OM_id)
inner join dbo.TypeTableInfo TTI on(TTI.TTI_id=PIF.PI_TinfoId)) as DB
这样我为什么不能把 '编号'这一列不能显示出来.。
把所有字段设为 * 它就可以了显示 '编号'这个列出来了..
select * from (select row_number() over(order by PI_id asc)as '编号',*
from dbo.ParkInfo as PIF inner join dbo.ParkSell as PS on(PS.PS_id=PIF.PI_PSid)
inner join dbo.OperationMessage as OM on(PS.PS_OMid=OM.OM_id)
inner join dbo.TypeTableInfo TTI on(TTI.TTI_id=PIF.PI_TinfoId)) as DB
请问这是为什么.。? 展开
1个回答
展开全部
select PI_PSid,OM_name,PS_carNumber,PI_price,TTI_infoName,PS_pho,PS_shopingTime,PS_EedTime,PS_remark ,'编号'
from (select row_number() over(order by PI_id asc)as '编号',*
from dbo.ParkInfo as PIF inner join dbo.ParkSell as PS on(PS.PS_id=PIF.PI_PSid)
inner join dbo.OperationMessage as OM on(PS.PS_OMid=OM.OM_id)
inner join dbo.TypeTableInfo TTI on(TTI.TTI_id=PIF.PI_TinfoId)) as DB
这样的嵌套查询当然在外层把列名加上才能显示,还有这个列名最好用英文.
另外,你用了row_number()方法,但没见着分页语句...
from (select row_number() over(order by PI_id asc)as '编号',*
from dbo.ParkInfo as PIF inner join dbo.ParkSell as PS on(PS.PS_id=PIF.PI_PSid)
inner join dbo.OperationMessage as OM on(PS.PS_OMid=OM.OM_id)
inner join dbo.TypeTableInfo TTI on(TTI.TTI_id=PIF.PI_TinfoId)) as DB
这样的嵌套查询当然在外层把列名加上才能显示,还有这个列名最好用英文.
另外,你用了row_number()方法,但没见着分页语句...
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询