日期:2014-05-16 浏览次数:20479 次
CREATE procedure proc_get(
@mac varchar(64),
@sortval int
) as
begin
select top 2* from (
select sortval,id,pushtime,name,details from (
select row_number()over(order by pushtime desc)as sortval,id,pushtime,name from Tab_Push inner join Tab_Info on tarmac=@mac and Tab_Push.id = Tab_Info.id and Tab_Info.isenable=1) A
inner join Tab_infoEx on A.id = Tab_infoEx.id
)B where sortval > @sortval order by sortval
end
CREATE procedure proc_get(
@mac varchar(64),
@sortval int
) as
begin
select top 2 * from (
select row_number()over(order by pushtime desc)as sortval,id,pushtime,name, details from
(Tab_Push inner join Tab_Info on tarmac=@mac and Tab_Push.id = Tab_Info.id and Tab_Info.isenable=1)
inner join Tab_infoEx on Tab_Push.id = Tab_infoEx.id
)C where sortval > @sortval
end
CREATE procedure proc_get(
@mac varchar(64),
@sortval int
) as
begin
select sortval,id,pushtime,name, details from(
(select top 2 * from
(select row_number()over(order by pushtime desc)as sortval, pushtime, id from Tab_Push inner join Tab_Info on tarmac=@mac and Tab_Push.id = Tab_Info.id and Tab_info.isenable=1) A
where sortval > @sortval)B
inner join Tab_Info on B.id = Tab_Info.id )
inner join Tab_infoEx on B.id = Tab_infoEx.id
end