Hi Albert,

... which is what I normally use but, in this case, it works correctly - ie,
as I expect! - the other way around.

Regards, Alastair.

----- Original Message -----
From: "Albert Berry" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 10, 2002 3:39 PM
Subject: RE: Sequencing the Where & the Sort statements


> Correct syntax for SQL statements (most languages) is SELECT ... FROM ...
WHERE ... [Group by] ... ORDER BY
>
> There are some odd exceptions, such as SyBase that has its own syntax
rules, but db2, rbase, access  and sqlserver use the sequence above
>
>
> "Alastair Burr" <[EMAIL PROTECTED]> wrote:
>
> >Hello all,
> >
> >I have always believed that it made no difference whether you wrote a
> >command as:
> >
> >select ... from ... where ... order by ...
> >
> >or as:
> >
> >select ... from ... order by ... where ...
> >
> >However, I have a report where it does appear to matter.
> >
> >If I use:
> >
> >PRINT Last100_HTML +
> >WHERE COUNT > .vCount +
> >ORDER BY MainName, FirstName, ReleaseSequence
> >
> >the sort that is applied appears to be by FirstName then MainName then
> >ReleaseSequence! However, if I write the command as:
> >
> >PRINT Last100_HTML +
> >ORDER BY MainName, FirstName, ReleaseSequence +
> >WHERE COUNT > .vCount
> >
> >then the sort works as expected. There are no break points defined on the
> >report.
> >
> >Is this something that has changed over the years and I simply haven't
> >noticed or is it to do with the way that data is selected when compared
to
> >the count (or any other?) function?
> >
> >Thanks for any enlightenment,
> >Regards,
> >Alastair.
> >
> >----------------------------------
> >A D B Burr,
> >St. Albans, UK.
> >----------------------------------
> >[EMAIL PROTECTED]
> >----------------------------------
> >
> >================================================
> >TO SEE MESSAGE POSTING GUIDELINES:
> >Send a plain text email to [EMAIL PROTECTED]
> >In the message body, put just two words: INTRO rbase-l
> >================================================
> >TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> >In the message body, put just two words: UNSUBSCRIBE rbase-l
> >================================================
> >TO SEARCH ARCHIVES:
> >http://www.mail-archive.com/rbase-l%40sonetmail.com/
> >
>
>
> __________________________________________________________________
> Your favorite stores, helpful shopping tools and great gift ideas.
Experience the convenience of buying online with Shop@Netscape!
http://shopnow.netscape.com/
>
> Get your own FREE, personal Netscape Mail account today at
http://webmail.netscape.com/
>
> ================================================
> TO SEE MESSAGE POSTING GUIDELINES:
> Send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: INTRO rbase-l
> ================================================
> TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: UNSUBSCRIBE rbase-l
> ================================================
> TO SEARCH ARCHIVES:
> http://www.mail-archive.com/rbase-l%40sonetmail.com/

================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/

Reply via email to