现在是这样的:
一个组合的查询,在asp中我这样写
sql="select id,biaoti,type,date1,link from xinwen where id<>''"
if biaoti<>"" then sql=sql+"and biaoti like '%"&biaoti&"%'"
if lanmu<>"" then sql=sql+"and type='"&lanmu&"'"
sql=sql+"order by id desc"
rs.open sql,conn,3,2
现在想在sql server中的存储过程该如何?因为有参数,所以不知!¬
select * from table where aa like '%aa' --查询以aa结尾
select * from table where aa like 'aa%' --查询以aa开头
select * from table where aa like '%aa%' --查询aa在任意位置