Results 1 to 2 of 2

Thread: query

  1. #1
    Join Date
    Jun 2005
    Posts
    85

    Unanswered: query

    Hi,

    select * from test a where test.col1 = a;

    The above query will not work and it will throw the error 'The column prefix 'test' does not match with a table name or alias name used in the query'. i.e if alias defined for a table, then the columns can be qualified only using using the alias. Is it true ? Is it true in all the places like "Group By', 'Order' , 'SELECT list' etc. Is that true in all databases, is it ANSI standard ?

    Please advice,

    Thanks,
    MiraJ

  2. #2
    Join Date
    Feb 2004
    Location
    Bangalore, India
    Posts
    250
    hi

    from BOL
    "If an alias is assigned to a table, all explicit references to the table in the Transact-SQL statement must use the alias, not the table name."
    Cheers....

    baburajv

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •