捷信达酒店管理系统其他消费明细SQL查询语句

捷信达酒店管理系统其他消费明细SQL查询语句

select SUM(Amount)
from gsfoliodetail a  ,
            (
                select a.pcode,a.cname from  gsitem a
                where a.code like '0%' and len(a.pcode) = 6
            ) b
        where ( substring(a.itempcode,1,6) = b.pcode)and  pcode like  '001010%'  
 



select *
from gsfoliodetail a  ,
            (
                select a.pcode,a.cname from  gsitem a
                where a.code like '0%' and len(a.pcode) = 6
            ) b
        where ( substring(a.itempcode,1,6) = b.pcode)and  pcode like  '001010%'  

猜你喜欢

转载自www.cnblogs.com/landv/p/9259847.html