select
COUNT(pc.property_id) AS [Total Count of Closed],
SUM(pc.sale_price) AS [Total Sum of Sales Price],
SUM(pc.advanced_seller_proceeds) AS [Total Sum of Net Proceeds],
SUM(pc.sale_price) * 100/SUM(pc.sale_price) AS [Percentage of Total Sales Price],
SUM(pc.advanced_seller_proceeds) * 100/SUM(pc.advanced_seller_proceeds) AS [Percentage of Total Net Proceeds],
AVG(DATEDIFF(day,pd.list_dt,pc.close_dt)) AS [Average Days from List Date to Close Date]
from resnet_mysql.dbo.property_closings pc
join resnet_mysql.dbo.property_details pd
on pc.property_id = pd.property_id
where pc.res_id = 201
我試圖獲得總銷售價格的百分比,但我一直得到100%。請幫忙。SQL:獲取百分比
你用相同的thing..you'll將明顯得到100%。 –
我沒有足夠的信譽發佈圖片 – csowner17
放入我們爲您編輯的鏈接。 –