Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
tbc
Starting Member
3 Posts |
Posted - 2006-12-04 : 23:13:21
|
| I absolutely agree with you.I managed to find the error, it was a typo.Here is the code, if somebody is interested about it. It is oracle, not SQL server, but the idea is the same.drop view a;drop view b;drop view figure5_9;create view aasselect d.donorID, dt.donortype, dt.donortargetq1from donortype dt, donor dwhere d.donortype=dt.donortype;select * from a;create view basselect a.donortype, sum(c.ContributionAmount) as amountfrom Contribution c, awhere c.ContributionDate between '01-JAN-06' and '31-MAR-06' and a.donorID=c.donorIDgroup by a.donortype;select * from b;create view figure5_9asselect b.donortype, a.donortargetq1, b.amount, b.amount/a.donortargetq1 as percentagefrom a, bwhere a.donortype=b.donortypegroup by b.donortype, a.donortargetq1, b.amount;select * from figure5_9;Thanks for the help anyway ;-) |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-12-04 : 23:27:17
|
| I'll give you a D minus on that one.You should have done it in one SELECT statement, and you should have used the ANSI join syntax.I don't think the result is correct either, but you didn't state the problem very well, so it's hard to tell.CODO ERGO SUM |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2006-12-04 : 23:36:26
|
| Let's see:1. Twice told that we don't answer homework/assignment questions, posts a third time anyway.2. Posts Oracle questions on a SQL Server site.Hope your burger flipping skills are top-notch. |
 |
|
|
|
|
|
|
|