ALTER PROCEDURE [dbo].[SP_Something]
(
@Search_Text VARCHAR(4000),
@FILTER INT
)
AS
BEGIN
SELECT Customer_Information
FROM Customer
LEFT OUTER JOIN Something K
ON K.Something _Id= Something_Id2
LEFT OUTER JOIN Something3 KS
ON KS.Something_Id =Something_Id3
WHERE
(Filter = 1 AND Customer_İnformation LIKE '%' + @Search_Text + '%')
OR
(Filter = 2 AND Customer_name LIKE '%' + @Search_Text + '%')
OR
(Filter = 3 AND Customer_Adress LIKE '%' + @Search_Text + '%')
END
我从Customer Table获取所有数据。
我需要从PRODUCT_TABLE获取以下代码的数据,
(Filter = 3 AND Customer_Adress LIKE '%' + @Search_Text + '%')
from PRODUCT_TABLE
我怎样才能在 Sql 女士的“哪里”中实现这一点?
任何帮助将不胜感激。
谢谢。