Article View: bit.listserv.sqlinfo
Article #256Re: SQL Syntax Question
From: ursidious
Date: Wed, 28 Aug 2002 00:15
Date: Wed, 28 Aug 2002 00:15
24 lines
1753 bytes
1753 bytes
no, its not a bug, ansi sql just doesn't allow you to refer to a column alias in a where clause. "Greg Doherty" <no spam please> wrote in message news:umcv5795a4bjac@corp.supernews.com... > Below is the same query written in 2 different ways. Since I'm specifying > an alias "aaa_no" for the column "Part.lPartNo", I would assume that I > should be able to use that alias in the where clause. Is my assumption > correct? Is this valid SQL syntax (SQL - 92)? If so, I will report it to > my vendor as a bug (Pervasive.SQL 2000i). > > WORKS: > SELECT Part.lPartNo AS "aaa_no" FROM Part WHERE Part.lPartNo = 1 > > DOESN'T WORK: > SELECT Part.lPartNo AS "aaa_no" FROM Part WHERE "aaa_no" = 1 > > Thanks, > - Greg > > >
Technical Details
Message-ID:
<ACUa9.101649$aA.21488@sccrnsc02>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn4feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!sccrnsc02.POSTED!not-for-mailReferences:
<umcv5795a4bjac@corp.supernews.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11355a,255f2bc1ac9d01ea X-Google-Attributes: gid11355a,public X-Google-ArrivalTime: 2002-08-27 17:15:29 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn4feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!sccrnsc02.POSTED!not-for-mail From: "ursidious" <ursidious@attbi.com> Newsgroups: bit.listserv.sqlinfo References: <umcv5795a4bjac@corp.supernews.com> Subject: Re: SQL Syntax Question Lines: 26 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: <ACUa9.101649$aA.21488@sccrnsc02> NNTP-Posting-Host: 65.96.250.159 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc02 1030493728 65.96.250.159 (Wed, 28 Aug 2002 00:15:28 GMT) NNTP-Posting-Date: Wed, 28 Aug 2002 00:15:28 GMT Organization: AT&T Broadband Date: Wed, 28 Aug 2002 00:15:28 GMT