Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

SQL query woes

$
0
0

So I have 3 tables:  "Project" and "Expenses" and "Report"   

What I need to do is insert into corresponding "report.id" row the sum of "expenses.AMT" based off "project.id" and "project.status" of active

For example, project 24 is an active status, and has expenses of 200 and 375, then it needs to enter 575 into the "report" table row that has "report.id" equal to 24. 


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>