You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sql-tools/Import/宝贝萌/bmm分离.sql

73 lines
2.5 KiB

1 year ago
use qingdao_meichen
UPDATE TMember SET FMemNO = REPLACE(FMemNO,'<EFBFBD><EFBFBD>baobeimengɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',''),FMemo = REPLACE(FMemo,'<EFBFBD><EFBFBD>baobeimengɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',''),FDeleted= 0
WHERE FMemo LIKE '%<EFBFBD><EFBFBD>baobeimengɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>%'
AND FDeleted = 1
UPDATE TMemberCard SET FCardNo = REPLACE(FCardNo,'<EFBFBD><EFBFBD>baobeimengɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',''),FMemo = REPLACE(FMemo,'<EFBFBD><EFBFBD>baobeimengɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',''),FDeleted= 0
WHERE FMemo LIKE '%<EFBFBD><EFBFBD>baobeimengɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>%'
AND FDeleted = 1
UPDATE TMemberCourse SET FMemo = REPLACE(FMemo,'<EFBFBD><EFBFBD>baobeimengɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',''),FDeleted= 0
WHERE FMemo LIKE '%<EFBFBD><EFBFBD>baobeimengɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>%'
AND FDeleted = 1
SELECT * FROM TCompany
WHERE FNo NOT IN('002','003','004','005','010','012','013','015','017','018','019')
--ɾ<EFBFBD><EFBFBD>
UPDATE TMemberCard SET FDeleted = 1,FCardnO = FCardNo + '<EFBFBD><EFBFBD>baobeimengɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',FMemo = FMemo + '<EFBFBD><EFBFBD>baobeimengɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
WHERE FCompId NOT IN(SELECT FId FROM TCompany WHERE FNo IN('002','003','004','005','010','012','013','015','017','018','019'))
AND FDeleted = 0
AND FMemID > 0
UPDATE TMemberCourse SET FDeleted = 1,FMemo = FMemo + '<EFBFBD><EFBFBD>baobeimengɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
WHERE FCompId NOT IN(SELECT FId FROM TCompany WHERE FNo IN('002','003','004','005','010','012','013','015','017','018','019'))
AND FDeleted = 0
AND FMemID > 0
--ɾ<EFBFBD><EFBFBD>
UPDATE TMember SET FDeleted = 1,FMemNo = FMemNo + '<EFBFBD><EFBFBD>baobeimengɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',FMemo = FMemo + '<EFBFBD><EFBFBD>baobeimengɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
WHERE FCompId NOT IN(SELECT FId FROM TCompany WHERE FNo IN('002','003','004','005','010','012','013','015','017','018','019'))
AND FMemID NOT IN(SELECT FMemId FROM TMemberCard WHERE FDeleted = 0)
AND FMemID NOT IN(SELECT FMemId FROM TMemberCourse WHERE FDeleted = 0)
AND FMemID > 0
SELECT * FROM TCompany
UPDATE TCompany SET FNo = FNo + '<EFBFBD>ѷ<EFBFBD><EFBFBD><EFBFBD>',FDeleted = 1 WHERE FNo NOT IN('002','003','004','005','010','012','013','015','017','018','019')
use qingdao_baobeimeng
--ɾ<EFBFBD><EFBFBD>
UPDATE TMemberCard SET FDeleted = 1,FCardnO = FCardNo + '<EFBFBD><EFBFBD>baobeimengɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',FMemo = FMemo + '<EFBFBD><EFBFBD>baobeimengɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
WHERE FCompId IN(3472334686330552320)
AND FDeleted = 0
AND FMemID > 0
UPDATE TMemberCourse SET FDeleted = 1,FMemo = FMemo + '<EFBFBD><EFBFBD>baobeimengɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
WHERE FCompId IN(3472334686330552320)
AND FDeleted = 0
AND FMemID > 0
--ɾ<EFBFBD><EFBFBD>
UPDATE TMember SET FDeleted = 1,FMemNo = FMemNo + '<EFBFBD><EFBFBD>baobeimengɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',FMemo = FMemo + '<EFBFBD><EFBFBD>baobeimengɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
WHERE FCompId IN(3472334686330552320)
AND FMemID NOT IN(SELECT FMemId FROM TMemberCard WHERE FDeleted = 0)
AND FMemID NOT IN(SELECT FMemId FROM TMemberCourse WHERE FDeleted = 0)
AND FMemID > 0
USE QINGDAO_BAOBEIMENG
UPDATE TCompany SET FNo = REPLACE(FNo,'<EFBFBD>ѷ<EFBFBD><EFBFBD><EFBFBD>','') ,FDeleted = 0 WHERE FDeleted = 1
SELECT * FROM TCompany