我想過濾,其通過使用存儲的過程包含空間數據...這裏是通過使用此我可以篩選如果在列數據數據假設代碼如何在like子句中逃避空間?
ALTER PROCEDURE [dbo].[sp_ProductDetail1]
@SearchKeyword nvarchar(50) = null
AS
BEGIN
SET NOCOUNT ON;
select T.*,P.*,PV.* from TranmissionRecord as T
inner join Price_tbl as P On P.PartNo = T.Part_number
inner join ProductVRM as PV On PV.V_PID = T.V_PID
where (REPLACE([T].[ProGrp_SubGrp_SubName], ' ', '') LIKE '%' + @SearchKeyword + '%') OR (PV.Make like '%' + @SearchKeyword + '%')OR (PV.Model like '%' + @SearchKeyword + '%') OR (PV.EngineModel like '%' + @SearchKeyword + '%') OR (PV.Fuel like '%' + @SearchKeyword + '%') OR (T.Product_code like '%' + @SearchKeyword + '%') OR (PV.EngineSize like '%' + @SearchKeyword + '%') OR (PV.EngineNo like '%' + @SearchKeyword + '%') OR (T.MSCode like '%' [email protected]+ '%') OR (T.ProGrp_SubGrp_Code like '%' [email protected]+ '%') OR (T.ProGrp_SubGrp_Name like '%' [email protected]+ '%') OR (T.Model_details like '%' [email protected]+ '%') OR (T.SubModelGroup like '%' [email protected]+ '%') OR (T.Part_number like '%' [email protected]+ '%') OR (T.Supplier like '%' [email protected]+ '%') OR (T.Description like '%' [email protected]+ '%') OR (T.SupplierAdditionalInformation_01 like '%' [email protected]+ '%') OR (T.FuelDelivery like '%' [email protected]+ '%') OR (T.TransmissionTypes like '%' [email protected]+ '%') OR (T.MMI_key like '%' [email protected]+ '%') OR (T.Year_range like '%' [email protected]+ '%') OR (T.Position like '%' [email protected]+ '%') OR (T.Section like '%' [email protected]+ '%') OR (T.Supplier like '%' [email protected]+ '%') OR (T.SupplierAdditionalInformation_07 like '%' [email protected]+ '%') OR (P.PartSubName like '%' [email protected]+ '%') OR (P.PartNo like '%' [email protected]+ '%') OR (P.Price like '%' [email protected]+ '%') OR (PV.Vrm like '%' [email protected]+ '%') OR (PV.Vin like '%' [email protected]+ '%') OR (PV.Transmission like '%' [email protected]+ '%') OR (PV.YearOfManufacture like '%' [email protected]+ '%') OR (PV.MamMake like '%' [email protected]+ '%') OR (PV.MamModel like '%' [email protected]+ '%')
END
是「ABS環」和我「LL型‘ABS環’,那麼它會顯示所有的數據,但我想,如果我輸入‘ABS’或‘absring’或‘AB’......我的意思是必須匹配的關鍵字來過濾數據...
請幫我,這將是很大的幫助...感謝u人
,你能否告訴我們,舉例來說,某些輸入連同你是否希望他們能夠匹配? –
是啊...爲什麼不....我的表中有一列名爲「ProGrp_SubGrp_SubNam」,並有數據「ABS環」,所以我想過濾數據使用此列名稱....但條件是如果用戶類型「ab」,「absring」或「abs」...十它必須顯示所有匹配的數據。 –
你可能想看看全文或者有多個或從句 – TheGameiswar