SIMPLE JOIN QUERY

  • I have 3 tables A,B,C

    Here are column and field names

    A:app_no,app_name,app_add

    B:b_no, B_code,B_rates

    C:c_no, C_degree,C_humidity

    There is common field in all 3 tables but their field names are different. (in above example app_no,b_no and c_no have exact same information which link the tables)

    i want to list following columns app_name,B_Rates and C_humidify,C_degree

    I tried this with some errors

    select app_name,B_Rates and C_humidify,C_degree

    from A join B join C

  • rk1980factor (5/23/2016)


    I have 3 tables A,B,C

    Here are column and field names

    A:app_no,app_name,app_add

    B:b_no, B_code,B_rates

    C:c_no, C_degree,C_humidity

    There is common field in all 3 tables but their field names are different. (in above example app_no,b_no and c_no have exact same information which link the tables)

    i want to list following columns app_name,B_Rates and C_humidify,C_degree

    I tried this with some errors

    select app_name,B_Rates and C_humidify,C_degree

    from A join B join C

    Quick suggestion

    😎

    SELECT

    AX.app_name

    ,BX.B_Rates

    ,CX.C_humidify

    ,CX.C_degree

    FROM A AX

    INNER JOIN B BX

    ON AX.app_no = BX.b_no

    INNER JOIN C CX

    ON AX.app_no = CX.c_no;

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

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