if(@type=‘Select_71’)
begin
begin tran
select *,(select count(1) from (select BFdate from PW_Booking
join IR_Account on PW_Booking.BID_Cart = IR_Account.Account_name
where BID_Cart like ‘%’+@BID_Cart+’%‘and BName like ‘%’+@BName+’%‘and BRoomID like ‘%’+@BRoomID+’%’
and BFYear like ‘%’+@BFYear+’%’ and BFMoney like ‘%’+@BFMoney+’%’
) c
) as count_Page from (
select top 100000 row_number() over(order by BookingID desc) ID,BookingID,AccountID,BID_Cart,BName
,(case when BSex=‘True’ then ‘男’ else ‘女’ end) ASex_Text
,(case when BSex=‘True’ then ‘LightSkyBlue’ else ‘pink’ end) ASex_Color
,BTelPhone,BRoomID,BFdate from PW_Booking
join IR_Account on PW_Booking.BID_Cart = IR_Account.Account_name
where BID_Cart like ‘%’+@BID_Cart+’%‘and BName like ‘%’+@BName+’%‘and BRoomID like ‘%’+@BRoomID+’%’
and BFYear like ‘%’+@BFYear+’%’ and BFMoney like ‘%’+@BFMoney+’%’
order by BookingID desc
) as table_BookingAndAccount
where ID between @Start_Page_vs and @End_Page_vs
select @@identity
commit tran
end
SQL分页以及分页数据总条数
猜你喜欢
转载自blog.csdn.net/weixin_44548307/article/details/103295435
今日推荐
周排行