color:red

SQL LIKE带变量模糊查询

SQL LIKE带变量模糊查询
2009-08-16 18:38

 

By Adrian   2009.08.16

CREATE PROC [dbo].[proc_GetPerInfoAndAvgMark]
@a VARCHAR(20)='',
@b VARCHAR(20)='',
@c VARCHAR(15)='',
@d VARCHAR(20)='',

AS

SELECT t_a, t_b, t_c, t_d, t_e, t_f
FROM PersonnelInfo
WHERE t_a LIKE
'%'+@a+'%' AND
        t_b LIKE
'%'+@b+'%' AND
        t_c LIKE
'%'+@c+'%' AND
        t_d LIKE
'%'+@d+'%'

posted on 2010-06-17 15:45  永不言弃program  阅读(14461)  评论(0编辑  收藏  举报

导航

color:red