select top 100 * from news where typeserial = 1
可以直接用typeserial接受参数@type阿
就象select top 100 * from news where typeserial = @type这样写就行了阿

解决方案 »

  1.   

    1:我晕
    2: Select identity(int,1,1) as id,* into #tmp from news
       Select * from #tmp where id between m and n
    3: 先看一下
      

  2.   

    多谢了.
    第一个确实有点麻烦,但是我觉得要不简化一下,传入存储过程的参数是个int类型的数组(不知道能不能用数组作为参数),比如说数组的内容比如为1,2,3, 那如何写SQL语句,即等效于
    typeserial = 1 or typeserial = 2 or typeserial = 3 ?to txlicenhe,是不是建立一个临时表? 我没看懂,能写详细点吗?