Doubt, how to use a sum command, with a result of 3 tables

Scripts Diversos para o Oracle SQL*Plus. (Relacionado a ferramenta Oracle SQL*Plus, para questões de SQL, usar o forum SQL)
Post Reply
marques1908
Rank: Estagiário Júnior
Rank: Estagiário Júnior
Posts: 1
Joined: Thu, 19 Feb 2009 9:42 am
Location: São Paulo - SP

Good morning, only beginner in SQL / Plus on Oracle Base, and I need to make a survey where I return the result of several customers, where the information is, the total annual movement (Table1), the total value (Table2) and qtde days of movement (Table3).
You can help.
grateful
Trevisolli
Moderador
Moderador
Posts: 2016
Joined: Wed, 12 Jan 2005 3:25 pm
Location: Araraquara - SP
Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP

Brother,

One of the ways of getting whatever, would be with Union:

Select all

 
select sum(qtd) qtd 
from tabela1 
union  
select sum(qtd) qtd 
from tabela2 
union 
select sum(qtd) qtd 
from tabela3; 
see if it helps you and, anything, send us.
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests