dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

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 ...



Reply

 

LinkBack Thread Tools Display Modes
  #1  
Old 11-25-2008, 12:09 AM
Database Newbie
 
Join Date: Nov 2008
Posts: 1
jaidering is on a distinguished road
Default Complicated query

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
Member_ID

Member: Member_ID
Member_Name
Contact_Number
Email
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
Reply With Quote
  #2  
Old 07-02-2009, 01:08 PM
Database Newbie
 
Join Date: Jul 2009
Posts: 1
wburnett is on a distinguished road
Default Re: Complicated query

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
Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 05:58 PM.