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

16 lines
564 B

1 year ago
use qingdao_vstar
SELECT A.FNo + A.FName as <EFBFBD>ײ<EFBFBD>,I.FNo + '-' + I.FName as <EFBFBD><EFBFBD>Ŀ,Comp.FNo+'-'+Comp.FAbbr,
M.FMemNO as <EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,M.FName as <EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
M.FMobilePHone as <EFBFBD>ֻ<EFBFBD>, CAST(C.FRemainPurTimes AS FLOAT) AS ʣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,C.FRemainFreeTimes
FROM TCoursePack AS A,TMemberCoursePack AS B
left join TCompany AS Comp on comp.FId = B.FCompId
,TMemberCourse AS C,TItem AS I,TMember AS M
WHERE C.FMemPackId = B.FId
AND B.FPackId = A.FId
AND I.FId = C.FItemId
AND M.FMemId = B.FMemId
AND M.FDeleted = 0
AND (C.FRemainPurTimes + C.FRemainFreeTimes) > 0
ORDER BY A.FNo ,I.FNo