摘要:
with temp_data as(select shareID,carID from dbo.che_ShareCar) select car_info.CARID, car_info.CAR_MARK , case when min(shareID) is null then 0 else COUNT(CAR_INFO.CARID) end as sharecount from dbo.CAR_INFO left join temp_data on CAR_INFO.CARID=temp_data.carID where COMPANYID=2 --and shareID is not n 阅读全文