Barney Boisvert wrote:
> That's still not the same query; it'll only work if each user only has a
> single record in the timelog table. Or did you mistype and all the
> 'timelogID's in the subquery should be replaced with 'userID's?
Only if you mistyped it in the original :-)
Jochem
[Todays Th
;s why MySQL has that
feature" is really reasonable, but it's damn near irrelevant anyway.
Cheers,
barneyb
> -Original Message-
> From: Jochem van Dieten [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 3:59 PM
> To: CF-Talk
> Subject: Re: Query of a quer
Barney Boisvert wrote:
>> If only one of them is unique, you need to normalize your data :)
>
> I need to pull out a list of users and the number of hours they've worked in
> the past year:
>
> SELECT user.userID, user.firstname, user.lastname,
> SUM(timelog.endTime - timelog.startTime) AS time
y 08, 2004 3:06 PM
> To: CF-Talk
> Subject: Re: Query of a query inconsistancies
>
> Barney Boisvert wrote:
> >> For some reason in MySQL this braindead syntax is allowed, but
> >> even the manual says the result may be 'unpredictable'
> >
> > It
Barney Boisvert wrote:
>> For some reason in MySQL this braindead syntax is allowed, but
>> even the manual says the result may be 'unpredictable'
>
> It's not totally brain dead.
I disagree :)
> I agree that if you don't know what you're
> doing, you shouldn't use it, but it is nice where you
> For some reason in MySQL this braindead syntax is allowed, but
> even the manual says the result may be 'unpredictable'
It's not totally brain dead. I agree that if you don't know what you're
doing, you shouldn't use it, but it is nice where you've got a series of
columns that you're grouping
Ah. That link explains it all. The OrderDate fields are not unique.
Thanks.
- Original Message -
From: "Jochem van Dieten" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, July 08, 2004 17:38 PM
Subject: Re: Query of a query inconsis
Todd Ashworth wrote:
>> Todd <[EMAIL PROTECTED]> wrote:
>>>
>>>
>>> SELECT *, COUNT(*) AS totalcount, SUM(Cost) AS totalcost
>>> FROM orders, orderitems
>>> WHERE orders.OrderID = orderitems.OrderID
>>> AND OrderDate >= '#DateFormat(StartTime, "-mm-dd")#'
>>> GROUP BY U
It does. On the first line I'm doing a SELECT *. that would include the
OrderDate column, would it not?
- Original Message -
From: "I-Lin Kuo" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, July 08, 2004 10:31 AM
Subject:
Logically, they're different. You shouldn't get any
results by moving the orderdate condition to the
bottom query, because qryGetRepeatSales doesn't have a
date column
--- Todd <[EMAIL PROTECTED]> wrote:
> I have these 2 queries:
>
>
> name="qryGetRepeatSales">
> SELECT *, COUNT(*) AS totalc
I have these 2 queries:
SELECT *, COUNT(*) AS totalcount, SUM(Cost) AS totalcost
FROM orders, orderitems
WHERE orders.OrderID = orderitems.OrderID
AND OrderDate >= '#DateFormat(StartTime, "-mm-dd")#'
GROUP BY UserID
HAVING totalcount > 1
SELECT SUM(totalcost) AS
11 matches
Mail list logo