我有一个存储过程,它使用LIKE
运算符在其他一些参数中搜索卡车位置
@location nchar(20),
@time time,
@date date
AS
select
DonationsTruck.VechileId, Phone, Location, [Date], [Time]
from
Vechile, DonationsTruck
where
Vechile.VechileId = DonationsTruck.VechileId
and (((Location like '%'+@location+'%') or (Location like '%'+@location) or (Location like @location+'%') ) or [Date]=@date or [Time] = @time)
我将其他参数设为空并仅按位置搜索,但即使我使用位置的全名,它也始终不返回任何结果