-
3 tables one select statements help plz
Hi,
I have 3 tables like these:
Table 1:People
Id Lname Fname Gender
Table2:Address_Info
Id Address City State Zip
Table3: Expense
Id Date Amount Type
I want to get a person with the largest total amount of money spent and return the Fname, Lname, address information and the total amount of all their expenses?
I use this query which does not work:
Select people.Fname, people.Lname, people.Gender, Address_Info.Address, Address_Info.City, Address_Info.State, Address_Info.Zip, SUM(Expense.Amount) AS Amount FROM People, Address_Info, Expense WHERE Amount=(Select SUM(Expense.Amount) from Expense);
please help
Thanks a lot
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|