Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. "Could not update a list of fields for the query. Verify that you can connect to the data source and that your query syntax is correct"
  2.  
  3. "An item with the same key has already been added"
  4.  
  5. Select *
  6. from
  7. (Select distinct srt.Name,
  8. percentile_disc(.5) WITHIN GROUP(ORDER BY (sr.price)) OVER(PARTITION BY srt.Name) AS MedianSpend
  9. from ServiceReq sr inner join ServiceReqTemplate srt
  10. on srt.RecId = sr.SvcReqTmplLink_RecID Where Name like '%') medQuery
  11. inner join
  12.  
  13. (select distinct srt.Name,
  14. cast(sum(sr.price) as int) as AvgCost,cast(sum(sr.cost) as int) as
  15. AvgTransCost,cast(avg(sr.TotalTimeSpent) as int) as TotalTimeSpent
  16. from ServiceReq sr, ServiceReqTemplate srt
  17. where sr.SvcReqTmplLink_RecID = srt.RecId
  18. group by srt.Name) avgQuery
  19. on medQuery.Name LIKE avgQuery.Name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement