Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2011
    Posts
    7

    Unanswered: Error while Concatinating

    Hi,
    When i running this query
    select (select count(*) from locations) + (select count(*) from regions) as "Total" from dual ... It's working fine.

    But i need to add one more column SUM(Amount) which will fetch the total amount. So i changed the query to
    select (select SUM(AMT),count(*) from locations) + (select SUM(AMT),count(*) from regions) as "Total" from dual. I am getting to many values error.

    What needs to be done for this?

  2. #2
    Join Date
    Dec 2008
    Location
    At work...
    Posts
    92
    Try:

    select SUM(AMT), count(*)
    from
    (select amt from locations
    union all
    select amt from regions)

  3. #3
    Join Date
    Nov 2011
    Posts
    7
    Hi Jarl

    Thnaks A lot it's working now !!!!

Posting Permissions

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