union query

  • In the following union query how do I order by ProviderNameLF ?

    SELECT TOP 100 PERCENT

    p.PartyID

    ,p.LastName + ', ' + p.FirstName

    AS ProviderNameLF

    FROM

    dbo.Person p

    UNION

    SELECT TOP 100 PERCENT

    o.PartyID

    ,o.OrganizationName AS ProviderNameLF

    FROM

    dbo.Organization o

  • Both of these should work

    ... rest of query...

    order by

    ProviderNameLF

    or

    ... rest of query...

    order by

    1

  • thanks! It works.

    Sam

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

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