Multiple like search In SQL Server
SELECT Tbla.* FROM Tbla
INNER JOIN Tblb ON
Tblb.col1 Like '%'+Tbla.Col2+'%'
Help Link : https://stackoverflow.com/questions/1865353/combining-like-and-in-for-sql-server
FROM( SELECT OBD.orderRowNo,OBD.OrderBookingID,OBD.OrderDetailBodyID,OBD.FabricDia,OBD.FabricGSM,OBD.KnittingOrderQty,OBD.DyeingOrderQty,FabricFormID,ColorID,OBD.FabricTypeID,OBD.YarnTypeID,OBD.MeasureUnitID,OBD.GarmentsColor
FROM
tblOrderBookingDetailBody OBD INNER JOIN tblOrderBookingHead OH ON OH.OrderBookingID=OBD.OrderBookingID
WHERE OH.OrderCurrentStatus=2) FX INNER JOIN #Orderinfo Tblb ON
FX.YarnTypeID Like '%'+CAST(Tblb.YarnTypeID AS VARCHAR)+'%'
AND FX.FabricFormID Like '%'+ CAST(Tblb.FabricFormID AS VARCHAR)+'%'
AND FX.ColorID Like '%'+ CAST(Tblb.ColorID AS VARCHAR)+'%'
AND FX.FabricTypeID Like '%'+ CAST(Tblb.FabricTypeID AS VARCHAR)+'%'
AND FX.FabricDia Like '%'+Tblb.FabricDia+'%'
AND FX.FabricGSM Like '%'+Tblb.FabricGSM+'%'
No comments:
Post a Comment
I am Safiqul Islam Tuhin