Table Reference In Query

  • I have writing a small query and have a quest. I need to use something like the following statement

    Select Status From StatusXref Where StatusXref.StatusId = ITRegInfo.Status

    I know how to accomplish this using a Join, but this statement is part of a sub select. Is is currently returning

    "The column prefix 'ITRegInfo' does not match with a table name or alias name used in the query."

    Does anyone know of a way to accomplish this with the use of Joins.

     

  • what you want to achieve ? send the table definition for both Statusxref and ITRegInfo tables.

    Assume its something like this...

    Select StatusXref.StatusId , ITRegInfo.Status From StatusXref Where StatusXref.StatusId = ITRegInfo.StatusId

    define your problem with table definitions, then somebody will be able to help!

    Linto

  • Like this???

    Select SX.Status

     From StatusXref SX

     join ITRegInfo ITRI

     on SX.StatusId = ITRI.Status

    Steve

  • Dear Awanvil,

        As SEQUEL Terminology Concerns,You can not have any reference to other table unless untill u join the both table.

    You can write in this manner....

     

    Select StatusXref .Status

     From StatusXref  INNER JOIN ITRegInfo 

     on StatusXref  .StatusId = ITRegInfo .Status

     

    Now you check it out ...

     

    Deepak

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply