Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2005
    Posts
    1

    Unanswered: Two rows returned with COUNT statement

    I have two SELECT COUNT(..) ... queries merged together with UNION and for the result I get two rows. I executed both queries separately and I see each row is a result of a one SELECT COUNT(..)

    How can I get just one row for a result?

    Regards

  2. #2
    Join Date
    Sep 2002
    Location
    Germany, near Aachen
    Posts
    120
    Try:

    Code:
    select sum(count) from (
        select count(*) as count from table1
        union
        select count(*) as count from table2
    )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •