[Fwd: Re: Where clause question]

2004-10-11 Thread Morten Egan
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

Re: Where clause question

2004-10-11 Thread Eamon Daly
- 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

RE: Where clause question

2004-10-11 Thread Ed Lazor
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

Re: Where clause question

2004-10-11 Thread Eamon Daly
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

Re: Where clause question

2004-10-11 Thread SGreen
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

Where clause question

2004-10-11 Thread Ed Lazor
I'm getting an unknown column error for discount with the following query. Any idea why? -Ed SELECT ID, Title, MSRP, Price, round( ( (MSRP - Price) / MSRP) * 100) as discount FROM `products` where discount > '10' limit 10 -- MySQL General Mailing List For list archives: http://lists.mysql.com/

Re: where clause question

2002-10-07 Thread Steve Edberg
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

Re: where clause question

2002-10-06 Thread Peter Goggin
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

where clause question

2002-10-06 Thread Alex Shi
Hi, I need a where clause in following situation: Say I want to query two tables: A and B. In table A there is field Afn, while in table B there ere 3 fields: Bfn1, Bfn2 and Bfn3. I want to compose a query, in which the where clause can do this: if A.Afn=1, then check Bfn1, if A.Afn=2, then c