Sorry, mailed it in html format. Read answer below
Original Message
Subject:Re: Where clause question
Date: Tue, 12 Oct 2004 00:00:12 +0200
From: Morten Egan <[EMAIL PROTECTED]>
To: Ed Lazor <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Not kno
- Original Message -
From: "Ed Lazor" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 11, 2004 4:51 PM
Subject: RE: Where clause question
Interesting. I thought you could sort by aliases. Thanks Shawn.
The easy answer was to just add the calculati
Interesting. I thought you could sort by aliases. Thanks Shawn.
The easy answer was to just add the calculation to the where section as
well. But which approach is faster - "having" or the calculation?
Ie.
select ID, Title, MSRP, Price, round( ( (MSRP - Price) / MSRP) * 100) as
discount from
r HAVING.
Eamon Daly
- Original Message -
From: <[EMAIL PROTECTED]>
To: "Ed Lazor" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, October 11, 2004 3:51 PM
Subject: Re: Where clause question
Because
Because "discount" isn't one of:
1) a field on one of the tables your query is based on
2) a formula based on one or more of the fields from one or more of the
tables your query is based on.
What it is: an alias to the results of a function applied to 2 fields on
one of your tables.
Since the
Well, it depends on what exactly you mean by 'checking' Bfn1, Bfn2
and Bfn3, but you should be able to do something like this (assuming
for this example that you want only want to return results where
Bfn1/Bfn2/Bfn3 is equal to 99):
select *
from table_a as A, table_b as B
where
This requires a similar function to Oracles decode. I do not know if MySQL
provides such a function.
Regards
Peter Goggin
- Original Message -
From: "Alex Shi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 07, 2002 6:47 AM
Subject: where clause question
> Hi,
>
> I