Looking up a value from another table

  • I have 2 tables

    Table 1

    Name office

    A USA

    B Mexico

    C Canda

    Small Office

    Mexico

    Canada

    I want the output as

    Name Office Small/largerOffice

    A USA Large

    B Mexico Small

    C Canada Small

  • Looks like a homework question. Hint: left join the first table to the second, and use COALESCE, ISNULL or CASE to return Small or Large in the second column.

    John

  • Looks like a rather bad design too.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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