alias in joins

  • Hello All

    We have integrated dynamic query for implementing SQL Reports.

    Queries are integrated dynamically with JOINS according to some criteria's...

    But a case arises where one alias is used by two tables say for an example...

    We have 20 tables in a database like T1, T2, T3........

    where

    T2 and T3 are primary tables and there are cases like

    1.Only T2 is joined in a query

    2.Only T3 is joined in a query

    3. Both T2 and T3 are in a query

    Now, if we are using tmp as alias for T2 OR T3, then 1st and 2nd case will work but fails for case 2 as both T2 and T3 have the same aliasing...

    How could we manage such scenario.... Please be note that queries are integrated dynamically according to some conditions...

    Thanks in Advance...

  • Can you show the queries and what you mean 'itegrated dynamically'?

    Dynamic Sql or something?

  • Dear Deepak,

    why are you using same alias for both the tables??

    Share the query so that we can have a better idea of the issue.

    Regards,
    Shafat Husain
    🙂
    And Your Lord Never Forgets...!! (64:19 -- Quran)

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

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