SELECT T1.ID,
T1.CustomerName,
T3.ProductName,
T2.LinkManID,
T4.FullName,
T2.ID AS SaleID,
T2.SellerID,
T2.DateFrom,
T2.DateTo,
T4.OfficeTel,
T2.Memo,
T1.Address,
T1.PostalCode
FROM CRM_Customers T1,CRM_Sale T2,base_Products T3,CRM_LinkMen T4
WHERE T1.IsDeleted = 0
AND T2.IsDeleted = 0
AND T2.Status <> 40
AND T2.CustomerID = T1.ID
AND T2.ProductID = T3.ID
AND T2.LinkManID = T4.ID
AND T1.CustomerName LIKE %+'sle_1.text'+%
AND T2.ProductID IN (+'st_18.text'+)
AND T4.FullName LIKE %+'sle_2.text'+%
AND T1.Address LIKE %+'sle_3.text'+%
AND T1.AreaID IN (+'qy'+)
AND T2.SellerID = 'xsy'
AND T2.Custom_1 = 'yjfw'
AND T2.DateFrom >=' em_3.text'
AND T2.DateFrom <='em_4.text'
AND T2.DateTo >= 'em_5.text'
AND T2.DateTo <= 'em_6.text'
AND T2.Memo LIKE %+'sle_4.text'+%
ORDER BY DateTo DESC
这句sql要赋值给一个字符串变量,这里面单引号,双引号该怎么加呢,其中qy,xsy,yjfw都是string型
------解决方案--------------------
sql 中变量要加 :
string s_id
s_id = sle_1.text
...
where id =:s_id;
------解决方案--------------------
string ls_a,ls_b
select a,b into :ls_a,ls_b from table1 ;
------解决方案--------------------
"select ...
wher id = '"+sle_1.text +"'"