In Search of the correct SQL statement

Discussion in 'Databases' started by bluebeard96, Dec 29, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. SELECTCompanyName FROM Adjusters
    UNION

    SELECTCompanyName FROM Insurance
    UNION
    SELECT CompanyName FROM Brokers
    ORDER BY CompanyName



    If the field names for companies are different in the three databases, use "ORDER BY 1" (the position, rather thanthe inconsistentvariable name)... like this



    SELECTCompany FROM Adjusters
    UNION

    SELECTCompanyName FROM Insurance
    UNION
    SELECTBrokerage FROM Brokers
    ORDER BY 1



    Hope this helps.


    Mike Reilly, Secretary/Webmaster
    Kiwanis Club of Rancho Penasquitos
    "Serving the Children of the World"
    [email protected]
    www.KiwanisPQ.org
    (760) 419-7429
     
  2. I have 3 tables with company names

    t1.adjusters
    t2.insurance
    t3.brokers

    I want to return a dataset (single column) with unique company names fromall 3 tables (sorted)


    HELP!!
     
  3. It Sure did !!

    Thanks
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page