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/琦品/奇品.sql

313 lines
14 KiB

SELECT * FROM TWebAppInfo
SELECT * FROM TCompany
SELECT * FRO
SELECT * FROM TWeChatUser
SELECT * FROM TImpCourse WHERE FItemID = 0
select * from TMemb WHERE FMemId = 439201511111324508
select * from TImpCourse WHERE FMemId = 439201511111324508
SELECT * FROM TImpCard WHERE FCardNo = 'jb0617'
SELECT * FROM TItem WHERE FName = '»ÊÊҼ羱¼õѹ'
UPDATE A
SET A.FItemId = B.FItemId,
A.FCourseId = B.FId
FROM TImpCourse AS A,TCourse AS B, TItem AS C
WHERE C.FName = A.LCXMMC
AND C.FId = B.FItemId
AND A.FItemID = 0
update a
set a.fiTEMid = b.fiTEMiD
,A.FCOURSEID = B.FCOURSEId
FROM TImpCourse AS B,TMemberCourse AS A
WHERE A.FId = b.fid
AND A.FItemId = 0
SELECT * FROM TItem WHERE FId = 8290968487171423457
SELECT M.FCompId,M.FMemNo,M.FName,A.FId,B.FName,C.LCXMMC FROM TConsumeItem AS A,TItem AS B,TImpCourse AS C,TMember AS M
WHERE A.FMemCourseId IN(
SELECT A.FId
FROM TImpCourse AS A,TItem AS I
WHERE A.FItemId = I.FId
AND A.LCXMMC != I.FName
)
AND A.FItemId = B.FId
AND C.FId = A.FMemCourseId
AND M.FMemId = C.FMemId
UPDATE TItem SET FName = REPLACE(REPLACE( REPLACE( FName,' ',''),'£¨','('),'£©',')')
UPDATE TImpCourse SET FItemName = REPLACE(REPLACE( REPLACE( FItemName,' ',''),'£¨','('),'£©',')')
UPDATE TImpCourse SET LCXMMC = REPLACE(REPLACE( REPLACE( LCXMMC,' ',''),'£¨','('),'£©',')')
SELECT IDENTITY(INT,1,1) AS FIndex, I.FNo,A.FItemName,I.FName,A.LCXMBM into #NewItem
FROM TImpCourse AS A,TItem AS I
WHERE 1=1
-- AND A.FId = 5201505311324373001
AND A.FItemID = I.FId
AND REPLACE(REPLACE( REPLACE(A.FItemName,' ',''),'£¨','('),'£©',')') !=
REPLACE(REPLACE( REPLACE(I.FName,' ',''),'£¨','('),'£©',')')
--AND I.FName = '£¨ÉíÌ壩ÉñµÄÓÕ»ó'
AND FItemName NOT IN(SELECT FName FROM TItem)
GROUP BY I.FNo,A.FItemName,I.FName,A.LCXMBM
ORDER BY SUM(1) DESC
SELECT * FROM TImpCourse WHERE FItemName LIKE '%ìøÒâÓÆÓÆ2´ú'
SELECT * FROM #NewItem
ALTER TABLE #NewItem ADD FNewItemNo VARCHAR(20)
UPDATE #NewItem SET FNewItemNo = 'L' + CAST(FIndex + 129 AS VARCHAR)
update #NewItem SET FIndex = FIndex + 129
INSERT TItem(FId,FNo,FNoOfPad,FName,FAbbr,FTypeId,FBriefCode,FDescription,FPriceMode,FIsService,FStatTimes,FCustom1,FCustom2,FCustom3,FEnabled,FPrice,FVipPrice,FTime,FDctId,FPointMode,FPointValue,FDeptId,FAllowBooking)
SELECT dbo.FNNewId(),FNewITEMNo,FNewITEMNo,FItemName,FItemName,0,dbo.FNGetFirstPinYin(FItemName),'''',1,1,1,'''','''','''',1,0,0,0,0,0,0,0,1
FROM #NewItem
SELECT * FROM TCourse
INSERT INTO TCourse(FId,FNo,FName,FBriefCode,FItemId,FPackId,FSequence,FTypeId,FTimes,FFreeTimes,FDurable,FValidityPeriodUnit,FValidityPeriod,FCreateDate,FExpiredDate,FDescription,FEnabled,FPrice,FAmount,FCalcMode)
SELECT dbo.FNNewId() AS FId,
I.FNo + 'L1',
I.FName + '-' + 'ÁƳÌ1' AS FName,
'' AS FBriefCode,
I.FId AS FItemId,
0 AS FPackId,
1 AS FSequence,
4822791688865541970 AS FTypeId,
1 AS FTimes,
0 AS FFreeTimes,
0 AS FDurable,
0 AS FValidityPeriodUnit,
0 AS FValidityPeriod,
getdate() AS FCreateDate,
NULL AS FExpiredDate,
'''' AS FDescription,
1 AS FEnabled,
0 AS FPrice,
0 AS FAmount,
1 AS FCalcMode
FROM TItem AS I
WHERE FNo IN(SELECT FNewItemNo FROM #NewItem)
UPDATE A
SET A.FNewItemId = B.FItemId,
A.FNewCourseId = B.FId
FROM TCourse AS B,TImpCourse AS A,TItem AS I
WHERE I.FId = B.FItemId
AND I.FName = A.FItemName
AND A.FItemName IN(SELECT DISTINCT A.FItemName FROM TImpCourse AS A,TItem AS B WHERE B.FId = A.FItemId AND A.FItemName != B.FName)
£¨ÉíÌ壩ìøÒâÓÆÓÆ2´ú
SELECT * FROM TCOnsumeItem WHERE FMemCourseId IN(
SELECT A.FId
FROM TImpCourse AS A,TItem AS I
WHERE 1=1
-- AND A.FId = 5201505311324373001
AND A.FItemID = I.FId
AND A.FItemName != I.FName
AND A.FItemName != '£¨ÉíÌ壩ìøÒâÓÆÓÆ2´ú'
)
SELECT * FROM TItem WHERE FName LIKE '%ÍÑë%'
--AND I.FName = '£¨ÉíÌ壩ÉñµÄÓÕ»ó'
GROUP BY I.FNo,A.LCXMMC,I.FName,A.LCXMBM
ALTER TABLE TImpCourse ADD FNewItemId BIGINT
ALTER TABLE TImpCourse ADD FNewCourseId BIGINT
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩ÉñµÄÓÕ»ó' WHERE FItemName = 'ÉñµÄÓÕ»ó'
UPDATE TImpCourse SET FItemName = 'ÃæµñÃ沿' WHERE FItemName = '£¨Ã沿£©GSDÃæµñÃ沿'
UPDATE TImpCourse SET FItemName = '£¨Ã沿£©²¹Ë®+ÉúÎﻹԭ' WHERE FItemName = '²¹Ë®+ÉúÎﻹԭ'
UPDATE TImpCourse SET FItemName = '²ÝÒ©Çò' WHERE FItemName = '£¨ÉíÌ壩ÈÈÓͲÝÒ©Çò'
UPDATE TImpCourse SET FItemName = 'ìøÒâÓÆÓÆ2´ú' WHERE FItemName = '£¨ÉíÌ壩ìøÒâÓÆÓÆ2´ú'
UPDATE TImpCourse SET FItemName = '£¨Ã沿£©²¹Ë®+ÉúÎﻹԭ' WHERE FItemName = '²¹Ë®+ÉúÎﻹԭ'
UPDATE TImpCourse SET FItemName = '£¨ÒÇÆ÷£©Ã沿¹âÈÈì' WHERE FItemName = 'Ã沿¹âÈÈì'
UPDATE TImpCourse SET FItemName = '£¨ÒÇÆ÷£©Ã沿¹âÈÈÎÞÍ´¾øë' WHERE FItemName = 'Ã沿¹âÈÈÎÞÍ´¾øë'
UPDATE TImpCourse SET FItemName = '£¨ÒÇÆ÷£©Ãæ¾±²¿±ùµç½ºÔ­ÐÂÉú¿¹Ë¥' WHERE FItemName = '¾±²¿±ùµç½ºÔ­ÐÂÉú¿¹Ë¥'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩ìøÒâÓÆÓÆ' WHERE FItemName = 'ìøÒâÓÆÓÆ'
UPDATE TImpCourse SET FItemName = '£¨ÒÇÆ÷£©Ãæ¹âµç¾»·ôÈáÃôÉî²ã²¹Ë®' WHERE FItemName = '¹âµç¾»·ôÈáÃôÉî²ã²¹Ë®'
UPDATE TImpCourse SET FItemName = '£¨ÒÇÆ÷£©Ãæ¹âµçÁÁÑÕÃÀ°×Éî²ã²¹Ë®' WHERE FItemName = '¹âµçÁÁÑÕÃÀ°×Éî²ã²¹Ë®'
UPDATE TImpCourse SET FItemName = '£¨ÒÇÆ÷£©Ãæ¹âµç½ôÖ¿Ƽ¼²¹Ë®' WHERE FItemName = '¹âµç½ôÖ¿Ƽ¼²¹Ë®'
UPDATE TImpCourse SET FItemName = '£¨ÒÇÆ÷£©Ãæ¹âµçÄý¼¡¿ØÓÍÉî²ã²¹Ë®' WHERE FItemName = '¹âµçÄý¼¡¿ØÓÍÉî²ã²¹Ë®'
UPDATE TImpCourse SET FItemName = '£¨ÒÇÆ÷£©Ãæ¾±Éî²ã»îϸ°û½ôÖÂÌáÉý' WHERE FItemName = '¾±²¿Éî²ã»îϸ°û½ôÖÂÌáÉý'
UPDATE TImpCourse SET FItemName = '£¨ÒÇÆ÷£©Ã沿Éî²ã»îϸ°ûÂÖÀªµñËÜ' WHERE FItemName = 'Ã沿Éî²ã»îϸ°ûÂÖÀªµñËÜ'
UPDATE TImpCourse SET FItemName = '£¨ÒÇÆ÷£©Ã沿¹âÈÈÁÁ°×ÄÛ·ô' WHERE FItemName = 'Ã沿¹âÈÈÁÁ°×ÄÛ·ô'
UPDATE TImpCourse SET FItemName = '£¨ÒÇÆ÷£©ÃæÑÛ²¿±ùµç½ºÔ­ÐÂÉú¿¹Ë¥' WHERE FItemName = 'ÑÛ²¿±ùµç½ºÔ­ÐÂÉú¿¹Ë¥'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩ÎÞÍ´¾øë' WHERE FItemName = 'ÎÞÍ´¾øë'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩¾»»¯ìø' WHERE FItemName = '¾»»¯ìø'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩¾ý×ÓºÃåÏ' WHERE FItemName = '¾ý×ÓºÃåÏ'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩ÉúÃüÖ®»¨' WHERE FItemName = 'ÉúÃüÖ®»¨'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩¹úÉ«ÌìÏã' WHERE FItemName = '¹úÉ«ÌìÏã'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩ÉúÃüÖ®Ô´' WHERE FItemName = 'ÉúÃüÖ®Ô´'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩Éî²ã»îϸ°ûÃÀÌå' WHERE FItemName = 'Éî²ã»îϸ°ûÃÀÌå'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩ÃÜÂëÑøÉú' WHERE FItemName = 'ÃÜÂëÑøÉú'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩±ùµçÌåµñ(ÅŶ¾)' WHERE FItemName = '±ùµçÌåµñ(ÅŶ¾)'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩±ùµçÌåµñ(¸ºÑ¹)' WHERE FItemName = '±ùµçÌåµñ(¸ºÑ¹)'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩±ùµçÌåµñ(ÉäƵ)' WHERE FItemName = '±ùµçÌåµñ(ÉäƵ)'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩ËĹú·çÇé' WHERE FItemName = 'ËĹú·çÇé'
UPDATE TImpCourse SET FItemName = '£¨Ã沿£©²¹Ë®+Ãæµñ' WHERE FItemName = '²¹Ë®+Ãæµñ'
UPDATE TImpCourse SET FItemName = '£¨Ã沿£©Éî²ãÊýÂëÀë×Ó²¹Ë®' WHERE FItemName = 'Éî²ãÊýÂëÀë×Ó²¹Ë®'
UPDATE TImpCourse SET FItemName = '£¨Ã沿£©Èá¹âÄÛ·ô' WHERE FItemName = 'Èá¹âÄÛ·ô'
UPDATE TImpCourse SET FItemName = '£¨Ã沿£©Èá¹âì' WHERE FItemName = 'Èá¹âì'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩ȫÉí¼õ·Ê' WHERE FItemName = 'È«Éí¼õ·Ê'
UPDATE TImpCourse SET FItemName = '£¨Ã沿£©Ô­Òº' WHERE FItemName = 'Ô­Òº'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩ÅÝÔè' WHERE FItemName = 'ÅÝÔè'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩ÈéÏÙÊèͨ' WHERE FItemName = 'ÈéÏÙÊèͨ'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩¸ë×ÓÊ÷Ðز¿Êèͨ' WHERE FItemName = '¸ë×ÓÊ÷Ðز¿Êèͨ'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩¸ë×ÓÊ÷Ðز¿ÊÕ½ô' WHERE FItemName = '¸ë×ÓÊ÷Ðز¿ÊÕ½ô'
UPDATE TImpCourse SET FItemName = '£¨Ã沿£©ÔÏ×ËÑÛ»¤' WHERE FItemName = 'ÔÏ×ËÑÛ»¤'
UPDATE TImpCourse SET FItemName = '£¨Ã沿£©¶úÖò' WHERE FItemName = '¶úÖò'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩±ùµçÌåµñ(ÉäƵ)ºó±³' WHERE FItemName = '±ùµçÌåµñ(ÉäƵ)ºó±³'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩±ùµçÌåµñ(ÉäƵ)Ñü' WHERE FItemName = '±ùµçÌåµñ(ÉäƵ)Ñü'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩±ùµçÌåµñ(ÉäƵ)¶Ç×Ó' WHERE FItemName = '±ùµçÌåµñ(ÉäƵ)¶Ç×Ó'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩GSDÃæµñÉíÌå' WHERE FItemName = '£¨ÉíÌ壩ÃæµñÉíÌå'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩·öÕýÌ÷罡¿µÀñºÐ' WHERE FItemName = '£¨ÉíÌ壩·ö·ç½¡¿µÀñºÐ'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩·öÕýÌ÷罡¿µÀñºÐ' WHERE FItemName = '·ç½¡¿µÀñºÐ'
UPDATE TImpCourse SET FItemName = '£¨ÅÝÔ裩·öÕýÌ÷ç²Ý±¾SPA¾«»ª' WHERE FItemName = '£¨ÉíÌ壩·ö·ç²Ý±¾SPA¾«»ª'
UPDATE TImpCourse SET FItemName = '£¨ÅÝÔ裩·öÕýÌøε¨²Ý±¾SPA' WHERE FItemName = '£¨ÉíÌ壩·ö¸Îµ¨²Ý±¾SPA¾«»ª'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩·öÕýÌøε¨Èá½î½¡¿µÀñºÐ' WHERE FItemName = '¸Îµ¨Èá½î½¡¿µÀñºÐ'
UPDATE TImpCourse SET FItemName = '£¨ÅÝÔ裩·öÕýÌøε¨²Ý±¾SPA' WHERE FItemName = '¸Îµ¨²Ý±¾SPA¾«»ª'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩·öÕýÌÃƢθÃÀ¼¡½¡¿µÀñºÐ' WHERE FItemName = '£¨ÉíÌ壩·öƢθÃÀ¼¡½¡¿µÀñºÐ'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩·öÕýÌÃƢθÃÀ¼¡½¡¿µÀñºÐ' WHERE FItemName = 'ƢθÃÀ¼¡½¡¿µÀñºÐ'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩·öÕýÌÃËÄ´óÁÜ°Í' WHERE FItemName = '£¨ÉíÌ壩·öËÄ´óÁÜ°Í'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩·öÕýÌÃËÄ´óÁÜ°Í' WHERE FItemName = 'ËÄ´óÁÜ°Í'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩·öÕýÌü¹ÖùÑø»¤½¡¿µÀñºÐ' WHERE FItemName = '£¨ÉíÌ壩·ö¼¹ÖùÑø»¤½¡¿µÀñºÐ'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩·öÕýÌü¹ÖùÑø»¤½¡¿µÀñºÐ' WHERE FItemName = '¼¹ÖùÑø»¤½¡¿µÀñºÐ'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩·öÕýÌÃÔÏζŮÈ˵÷Ñø½¡¿µ' WHERE FItemName = '£¨ÉíÌ壩·öÔÏζŮÈ˵÷Ñø½¡¿µÀñºÐ'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩·öÕýÌÃÔÏζŮÈ˵÷Ñø½¡¿µ' WHERE FItemName = 'ÔÏζŮÈ˵÷Ñø½¡¿µÀñºÐ'
UPDATE TImpCourse SET FItemName = '£¨ÅÝÔ裩·öÕýÌÃÔÏζŮÈËSPA' WHERE FItemName = '£¨ÉíÌ壩·öÔÏζŮÈ˲ݱ¾SPA¾«'
UPDATE TImpCourse SET FItemName = '£¨Ã沿£©Ë®ÑúÄý¼¡Éî²ã×ÌÈó»¤Àí' WHERE FItemName = 'Ë®ÑúÄý¼¡Éî²ã×ÌÈó»¤Àí'
UPDATE TImpCourse SET FItemName = '£¨Ã沿£©ÑÛÇ°Ò»ÁÁÌØЧÑÛ²¿»¤Àí' WHERE FItemName = 'ÑÛÇ°Ò»ÁÁÌØЧÑÛ²¿»¤Àí'
UPDATE TImpCourse SET FItemName = '£¨Ã沿£©ÌìÖ®½¿Å®Ó¨Èó±£Êª»¤Àí' WHERE FItemName = 'ÌìÖ®½¿Å®Ó¨Èó±£Êª»¤Àí'
UPDATE TImpCourse SET FItemName = '£¨Ã沿£©°×ÒÂÌìʹ¿¹Ãô»¤Àí' WHERE FItemName = '°×ÒÂÌìʹ¿¹Ãô»¤Àí'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩¾«ÓÍ¿ª±³' WHERE FItemName = '¾«ÓÍ¿ª±³'
UPDATE TImpCourse SET FItemName = '£¨ÉíÌ壩·öÕýÌÃÅ®ÈËÃÜÓïÐØ' WHERE FItemName = '£¨ÉíÌ壩·öÕýÌÃÐز¿'
UPDATE TImpCourse SET FItemName = '' WHERE FItemName = ''
UPDATE TImpCourse SET FItemName = '£¨Ã沿£©¼ÎÀÖ·ÒÈ˲ÎÊ滺SPA' WHERE FItemName = '£¨Ã沿£©¼ÎÀÖ·ÒÁƳÌ'
UPDATE TImpCourse SET FItemName = '£¨Ã沿£©ÉúÎﻹԭÃÀÈÝÃÀÌå' WHERE FItemName = 'ÉúÎﻹԭÃÀÈÝÃÀÌå'
UPDATE TImpCourse SET FItemName = '£¨ÅÝÔ裩·öÕýÌÃÏãÑÞÅ®ÈËSPA' WHERE FItemName = '£¨ÉíÌ壩·öÏãÑÞÅ®È˲ݱ¾SPA¾«'
UPDATE TImpCourse SET FItemName = '£¨Ã沿£©¼ÎÀÖ·ÒÈ˲ÎÊ滺SPA' WHERE FItemName = '¼ÎÀÖ·ÒÁƳÌ'
UPDATE TImpCourse SET FItemName = '£¨Ã沿£©GSDÃæµñ' WHERE FItemName = '£¨Ã沿£©GSDÃæµñÃ沿'
UPDATE TImpCourse SET FItemName = '(ÉíÌ壩ÈÈÓͲÝÒ©Çò' WHERE FItemName = '£¨ÉíÌ壩ÈÈÓͲÝÒ©Çò'
UPDATE TImpCourse SET FItemName = '(ÉíÌ壩ÈÈÓͲÝÒ©Çò' WHERE FItemName = '(ÉíÌ壩ÈÈÓͲÝÒ©Çò'
UPDATE TImpCourse SET FItemName = 'ìøÒâÓÆÓÆ2´ú' WHERE FItemName LIKE '%ìøÒâÓÆÓÆ2´ú'
UPDATE TImpCourse SET FItemName = '(ÉíÌå)ìøÒâÓÆÓÆ' WHERE FItemName = 'ìøÒâÓÆÓÆ'
UPDATE TImpCourse SET FItemName = '(ÉíÌå)±ùµçÌåµñ(ÉäƵ)' WHERE FItemName = '±ùµçÌåµñ(ÉäƵ)ÊÖ±Û'
UPDATE TImpCourse SET FItemName = '(ÉíÌå)·öÕýÌÃËÄ´óÁÜ°Í' WHERE FItemName = 'ËÄ´óÁÜ°Í'
UPDATE TImpCourse SET FItemName = '(ÅÝÔè)·öÕýÌÃÏãÑÞÅ®ÈËSPA' WHERE FItemName = 'ÏãÑÞÅ®È˲ݱ¾SPA¾«»ª'
UPDATE TImpCourse SET FItemName = '(Ã沿)GSDÃæµñ' WHERE FItemName = '(Ã沿)GSDÃæµñÃ沿'
UPDATE TImpCourse SET FItemName = '(ÉíÌå)ÈÈÓͲÝÒ©Çò' WHERE FItemName = '²ÝÒ©Çò'
UPDATE TImpCourse SET FItemName = 'ìøÒâÓÆÓÆ2´ú' WHERE FItemName = '(ÉíÌå)ìøÒâÓÆÓÆ2´ú'
UPDATE TImpCourse SET FItemName = '(ÉíÌå)ÈÈÓͲÝÒ©Çò' WHERE FItemName = '²ÝÒ©Çò'
UPDATE TImpCourse SET FItemName = '(ÉíÌå)ÈÈÓͲÝÒ©Çò' WHERE FItemName = 'ÃæµñÃ沿'
ALTER TABLE TImpCourse ADD FItemName VARCHAR(50)
UPDATE TImpCourse SET FItemName = LCXMMC
SELECT * FROM TImpCourse WHERE LCXMBM = '479'
SELECT * FROM TImpCourse WHERE LCXMMC = 'ÃæµñÃ沿'
--AND A. LCXMMC = '£¨Ã沿£©¶úÖò'
--GROUP BY A.FItemId, A.LCXMMC,I.FName,I.FNo
select * from TImpCourse WHERE FItemId = 610 AND LCXMMC = '±ùÇò'
SELECT * FROM TCompany
SELECT * FROM TMemberCardAccount WHERE FCardId = 253201402251358006
UPDATE TCompany SET FWeChatPayMchId = '1350440301'
SELECT * FROM TImpCard WHERE FCardNo = 'QB00001235'
ALTER TABLE TImpCard ADD FBalance2 DECIMAL(18,6)
UPDATE TImpCard SET FBalance2 = CAST(VIPZSJE AS DECIMAL(18,6))
WHERE VIPZSJE != 0.0
SELECT * FROM TCompany
SELECT * FROM TImpCard WHERE FBalance2 != 0
SELECT * FROM TUser WHERE FNo = '0288008'
SELECT FCompId FROM TUserAllowCompany WHERE FUserId = 5252777072562267853
SELECT * FROM TCp
INSERT TMemberCardAccount(FMemId,FId,FCardId,FAcctId,FDeposit,FBalance,FArrear,FCreateDate,FExpiredDate,FMemo)
SELECT FMemId,dbo.FNNewId(),FCardId AS FCardId,10,FBalance2,FBalance2,0,FCreateDate,NULL AS FExpiredDate,''
FROM TImpCard AS A
WHERE FCardId IN(SELECT FCardId FROM TMemberCard)
AND FBalance2 != 0
SELECT * FROM TGoodsSub WHERE FCompId = 5252777072562267853
INSERT TGoodsSub(FId,FCompId,FGoodsId)
SELECT dbo.FNNewId(),C.FId,I.FId
FROM TGoods AS I,TCompany AS C
WHERE I.FId != 0
AND C.FId = 5070814954448694070
AND NOT EXISTS(SELECT TOP 1 1 FROM TGoodsSub AS B WHERE B.FCompId = C.FId AND B.FGoodsId = I.FId)
SELECT * FROM TGoodsSub
DELETE TGoodsSub WHERE FCompId = 5070814954448694070
SELECT * FROM TConsumeGoods AS B,TConsumeBill AS A
WHERE B.FBILLID = A.FBILLID
AND A.FCompId = 5070814954448694070
INSERT TMemberCardAcctHist(FId,FMemId,FCardId,FAcctId,FTime,FCardTypeId,FCompId,FBillType,FBizType,FTransId,FTransNo,FInAmount,FOutAmount,FBalance,FArrear,FRecordTime,FMemo)
select dbo.FNNewId(),A.FMemId,A.FCardId,10,getdate(),A.FCardTypeId,A.FCompId,'DR','Import',0,'',A.FBalance2,0,A.FBalance2,0,getdate(),'´ÓÀÏϵͳµ¼Èë'
FROM TImpCard AS A
WHERE FCardId IN(SELECT FCardId FROM TMemberCard)
AND FBalance2 != 0
SELECT * FROM TPayAccount