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/统计短信扣费.sql

21 lines
652 B

use chongqing_xinchao
SELECT
COMP.FNo + '-' + COMP.FAbbr AS ,
M.FName AS ,
M.FMobilePhone AS ,
C.FCardNo as ,
T.FNo + '-' + T.FName AS ,
H.FTime AS ,
CAST(H.FOutAmount AS FLOAT)AS ,
cast(CA.FBalance AS FLOAT) AS
FROM TMemberCardAcctHist AS H
INNER JOIN TMemberCard AS C ON C.FCardId = H.FCardId
INNER JOIN TMember AS M ON M.FMemId = C.FMemId
INNER JOIN TMemberCardType AS T ON T.FId = C.FTypeId
INNER JOIN TMemberCardAccount AS CA ON CA.FCardId = C.FCardId AND CA.FAcctId =3
INNER JOIN TCompany AS COMP ON COMP.FId = C.FCompId
WHERE H.FBizType = 'SMSFee'
AND H.FAcctId = 3
ORDER BY COMP.FNo,FCardNo