Help with a JOIN query please

2005-03-18 Thread shaun thornburgh
Hi, I have ( among others ) three tables in my database: Claims, Expenses and Mileage. A claim can contain many expense entries and many mileage entries. I am using the follwing query to show the total expenses and mileage per claim for a particulare user: SELECT C.*, SUM(E.Amount) AS Amount,

Re: Help with a JOIN query please

2005-03-18 Thread Krasimir_Slaveykov
Hello shaun, May be with subselects you can do what you want: SELECT C.*,(select SUM(E.Amount) from Expenses E where E.Claim_ID = C.Claim_ID)AS Amount, (select SUM(M.Mileage) from Mileage M where M.Claim_ID = C.Claim_ID) AS Mileage FROM Claims C WHERE C.Claimant_ID = '1' st Hi, st I have (

Re: Help with a JOIN query please

2005-03-18 Thread SGreen
shaun thornburgh [EMAIL PROTECTED] wrote on 03/17/2005 06:46:22 PM: Hi, I have ( among others ) three tables in my database: Claims, Expenses and Mileage. A claim can contain many expense entries and many mileage entries. I am using the follwing query to show the total expenses and

Re: Help with a join query please!

2004-12-29 Thread shaun thornburgh
. Thanks again for your help! From: [EMAIL PROTECTED] To: shaun thornburgh [EMAIL PROTECTED] CC: mysql@lists.mysql.com,[EMAIL PROTECTED] Subject: Re: Help with a join query please! Date: Thu, 23 Dec 2004 10:14:24 -0500 So -- what's the field that relates a booking to an allocation? Do they share

Re: Help with a join query please!

2004-12-29 Thread SGreen
@lists.mysql.com,[EMAIL PROTECTED] Subject: Re: Help with a join query please! Date: Thu, 23 Dec 2004 10:14:24 -0500 So -- what's the field that relates a booking to an allocation? Do they share a project_ID or what? If they do, you might try this: SELECT DISTINCT U.User_ID, U.User_Firstname

Re: Help with a join query please!

2004-12-29 Thread shaun thornburgh
AND A.Project_ID = 11 ORDER BY User_Firstname; Thanks, Shaun From: [EMAIL PROTECTED] To: shaun thornburgh [EMAIL PROTECTED] CC: mysql@lists.mysql.com,[EMAIL PROTECTED] Subject: Re: Help with a join query please! Date: Wed, 29 Dec 2004 15:58:43 -0500 shaun thornburgh [EMAIL PROTECTED] wrote on 12/29/2004 03

Re: Help with a join query please!

2004-12-23 Thread shaun thornburgh
Hi, Thanks for your reply but that produces exactly the same result... Any ideas? From: Sasha Pachev [EMAIL PROTECTED] To: shaun thornburgh [EMAIL PROTECTED] CC: mysql@lists.mysql.com Subject: Re: Help with a join query please! Date: Tue, 21 Dec 2004 14:57:43 -0700 shaun thornburgh wrote: Hi, I

Re: Help with a join query please!

2004-12-23 Thread SGreen
: Sasha Pachev [EMAIL PROTECTED] To: shaun thornburgh [EMAIL PROTECTED] CC: mysql@lists.mysql.com Subject: Re: Help with a join query please! Date: Tue, 21 Dec 2004 14:57:43 -0700 shaun thornburgh wrote: Hi, I have (among others) three tables in my database that i am struggling with a join

Re: Help with a join query please!

2004-12-21 Thread Sasha Pachev
shaun thornburgh wrote: Hi, I have (among others) three tables in my database that i am struggling with a join query on. The database holds dates for Bookings. If Users are Allocated to a particular Project they can be booked. However if a user is booked but then unallocated I want to be able

Help with a join query please!

2004-12-20 Thread shaun thornburgh
Hi, I have (among others) three tables in my database that i am struggling with a join query on. The database holds dates for Bookings. If Users are Allocated to a particular Project they can be booked. However if a user is booked but then unallocated I want to be able to display all peolple

Re: Help with a join query please

2004-12-16 Thread Rhino
- Original Message - From: shaun thornburgh [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 16, 2004 2:02 PM Subject: Help with a join query please Hi, I have (among others) three tables in my database that i am struggling with a join query on. The database holds

Help with a join query please

2004-12-16 Thread shaun thornburgh
Hi, I have (among others) three tables in my database that i am struggling with a join query on. The database holds dates for Bookings. If Users are Allocated to a particular Project they can be booked. However if a user is booked but then unallocated I want to be able to display all peolple

Re: Help with a join query please

2004-12-16 Thread shaun thornburgh
From: Rhino [EMAIL PROTECTED] To: shaun thornburgh [EMAIL PROTECTED],[EMAIL PROTECTED] Subject: Re: Help with a join query please Date: Thu, 16 Dec 2004 14:59:48 -0500 - Original Message - From: shaun thornburgh [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 16, 2004 2