22,206
社区成员
发帖
与我相关
我的任务
分享
SELECT TOP 100 pid,
lastcontacttextnew,
remark,
createdate,
custcode,
custname
FROM vcu_customer
LEFT JOIN sy_share
ON (vcu_customer.pid = sharepid
AND sharetablename = 'Cu_Customer'
AND shareuserid = 246)
WHERE vcu_customer.pid NOT IN (SELECT TOP 0 vcu_customer.pid -- 这里怎么回事啊,存心折腾 SQL 是吧!
FROM vcu_customer
LEFT JOIN sy_share
ON (vcu_customer.pid = sharepid
AND sharetablename = 'Cu_Customer'
AND shareuserid = 246)
WHERE ((1 = 1)
AND (custpublictype IS NULL
OR custpublictype = 0)
AND (issaleok = 0
OR issaleok IS NULL))
AND (owner = 246
OR share = 1
OR shareuserid = 246))
AND ((1 = 1)
AND (custpublictype IS NULL
OR custpublictype = 0)
AND (issaleok = 0
OR issaleok IS NULL))
AND (owner = 246
OR share = 1
OR shareuserid = 246)
AND (custpublictype = 0
OR custpublictype IS NULL)