select   count(pid)   from   m_pics    
  WHERE   pPub=1    
  AND   pType=isnull(@pType,pType)    
  AND   pPixes=isnull(@pixes,pPixes)

通过isnull来解决

pType=isnull(@pType,pType)  

意思是

如果@pType is null

pType=pType

如果@pType is not null

 pType=@pType

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
  • 2021-10-13
猜你喜欢
  • 2021-06-14
  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
  • 2021-10-07
  • 2021-07-14
  • 2022-12-23
相关资源
相似解决方案