select top @pagesize * from tb_product A LEFT join tb_product B ON A.PROD_CODE = B.PROD_CODEwhere B.id> @pagesize*@pageindexORDER BY A.ID ,B.ID