select TH001,TH002,TH004,TH005,TH006,TH007,TG017,MB064,amt=TH007 * TG017,ljamt=0
from PURTG LEFT JOIN PURTH ON TG001=TH001 AND TG002=TH002 LEFT JOIN INVMB ON TH004=MB001 WHERE left(TH002,8) between '20080612' and '20080613'
AND
TH004='103097380' group By TH004,TH001,TH002,TH005,TH006,TH007,TG017,MB064
不知道我這樣寫對不對