Complicated query - sqlserver-server
This is a discussion on Complicated query - sqlserver-server ; Hi peope.I would need to get some help in creating this query. I am currently doing a project in which i need to have quite a complicated SQL query. I have got 2 tables. Donation: Donation_ID Donation_Date Donation_Amt Donation_Method Region_Name ...
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| |||
| |||
| I am currently doing a project in which i need to have quite a complicated SQL query. I have got 2 tables. Donation: Donation_ID Donation_Date Donation_Amt Donation_Method Region_Name Member_ID Member: Member_ID Member_Name Contact_Number Address Gender DOB Nationality CreditCardNumb Card_Type My objective is to get a final output in which only 1 member name is displayed. This member needs to be the person whose accumulated donation_amt is the maximum, compared to others. Its quite complicated for me. Please help me in this. please help |
|
#2
| |||
| |||
|
as a fast dirty way to do it, this simple query should work for you select top 1 * from donation, member where member.member_id=donation.member_id order by amt desc |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
All times are GMT -4. The time now is 05:58 PM.




Linear Mode