Re: Query to return 2 different names in same record

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Thanks again you have been a great help

"Hugo Kornelis" wrote:

On Sun, 5 Oct 2008 02:31:01 -0700, PeterW wrote:

Thanks you're a gent.
Does this stop the orderby, groupby, or where clause from working?

Hi Peter,

No. But you do need to keep using the aliases instead of the table names
whenever you refer to columns from the tables.

(Note that an alias is not required -though I presonally prefer it- for
tables that appear just once in a query - but tables appearing twice or
more do need an alias to seperate the "versions").

--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis

.



Relevant Pages

  • Re: Query to return 2 different names in same record
    ... Does this stop the orderby, groupby, or where clause from working? ... But you do need to keep using the aliases instead of the table names ... more do need an alias to seperate the "versions"). ... My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis ...
    (microsoft.public.sqlserver.mseq)
  • Re: create list of string matches for "LIKE" criteria
    ... Thanks Anith. ... I guess I felt that as SQL Server allow an alias or an expression, ... > aliases, ...
    (microsoft.public.sqlserver.programming)
  • Re: Help w/SQL
    ... I think you might be thinking of how SQL Server ... you can refer to an alias in an expression ... SELECT clause. ... SQL Server only considers aliases at the end ...
    (microsoft.public.access.queries)
  • Re: SQL Humor
    ... Hugo Kornelis wrote: ... SQL Server will often produce the same execution for both versions. ... the big questions for the RM, *for me* seem to include view updatability which has to do with the operators of the algebra as well as whether a relational engine can implement customary features such as concurrency control and presentation coherence without being written in a language that eschews the relational operators. ...
    (comp.databases.theory)
  • Re: Need help with hint syntax in SQL Server 2000
    ... unable to recognize that it shoul push the where clause condition down ... Hugo Kornelis, SQL Server MVP ... My SQL Server blog:http://sqlblog.com/blogs/hugo_kornelis ... Thank you both for the replies. ...
    (comp.databases.ms-sqlserver)