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,
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 (
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
.
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
@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
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
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
: 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
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
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
- 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
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
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
13 matches
Mail list logo