T_SQL join tables

  • hello;

    i have a query: Query1

    SELECT top 3 Error_ID,count(Error_ID),Kind

    FROM Table_1

    GROUP BY Error_ID,Kind

    i have another table wich name is Table_2 and its schema is :

    Error_ID [Desc] Kind

    i want to have the records from Table_2 which

    Error_ID (from Query1) is the same as the Error_ID (from Table_2).

    thanks

  • nazaninahmady_sh (3/4/2009)


    hello;

    i have a query: Query1

    SELECT top 3 Error_ID,count(Error_ID),Kind

    FROM Table_1

    GROUP BY Error_ID,Kind

    i have another table wich name is Table_2 and its schema is :

    Error_ID [Desc] Kind

    i want to have the records from Table_2 which

    Error_ID (from Query1) is the same as the Error_ID (from Table_2).

    thanks

    Try:

    ...

    FROM Table_1 INNER JOIN Table_2 on Table_1.Error_ID = Table_2.Error_ID

    ...

    If you have still problem let us know and check my signature and learn how to post you problem!

    ============================================================
    SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

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

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