SELECT * FROM TBasicType WHERE FName LIKE '%Å·À³ÑÅ%' OR FName LIKE '%¶à%' OR FName LIKE '%¶à%' SELECT * FROM TInventoryHist_Bak WHERE FGoodsId IN ( SELECT * INTO #Goods FROM TGoods WHERE FTypeId IN(SELECT FId FROM TBasicType WHERE FKey = 'GoodsType' AND FNo BETWEEN '30' AND '40') ) AND FId NOT IN (SELECT FId FROM TInventoryHist) AND FCompId = 3472331387795668992 SELECT * FROM TCompany SELECT * FROM #Goods WHERE FId IN(SELECT FGoodsId FROM TInventory WHERE FBatchNo != '') SELECT * FROM TInventoryHist_bak WHERE FCOmpId = 3472332487307296768 AND FGoodsId = 6594643888613597109 SELECT * FROM TInventoryHist WHERE FCOmpId = 3472332487307296768 AND FGoodsId = 6594643888613597109 SELECT * FROM TInventory WHERE FGoodsId = 8550081926225786938 SELECT * FROM TInventoryHist WHERE FGoodsId = 8550081926225786938 SELECT * FROM TCompany WHERE FId = 3472332487307296768 SELECT * FROM TGoods WHERE FNo LIKE '%KS007%' SELECT * FROM TBasicType WHERE FId = 5833645151690124907 SELECT * FROM TInventoryHist_Bak WHERE FGoodsId = 8550081926225786938 SELECT * FROM TInventoryHist_bak WHERE FCOmpId = 3472332487307296768 AND FGoodsId = 6594643888613597109 SELECT * FROM TInventoryHist_bak WHERE FCOmpId = 3472332487307296768 AND FGoodsId IN ( SELECT FId FROM TGoods WHERE FNo IN ( '9086245', 'KS007', 'KS008', 'KS011', 'OLY010 125ML', 'OLY017', 'OLY019 250ML', 'OLY031 250ML', 'OLY042 250ML', 'OLY089', 'OLY140', 'OLY143', 'OLY145', 'OLY152' ) ) SELECT * FROM TCompany INSERT TInventoryHist SELECT * FROM TInventoryHist_bak WHERE FCOmpId = 3472332487307296768 AND FGoodsId IN ( SELECT FId FROM TGoods WHERE FNo IN ( '09087175', '09087186', 'OLY061 250ML', 'OLY078 500ML', '330004', '330010', '340014', '340015', '340016', '340017', '350004', '380004', '390001', 'YSC*330001', 'YSC*330002') )