4 tablelas added

Dúvidas, dicas e truques de SQL, Select, Update, Delete, cláusulas, operações com joins, Funções em SQLs, etc
  

Poston Fri, 23 Nov 2007 1:37 pm

Hello guys, I wonder if I can do that will bring select 4 plsql for me? but the four are independent from each other e.g. on line 1 I want employees but in line 1 the sum of all employees in line 2 want the sum of the total of product in stock and some 4 a lines totaling etc of each different table?
carlos12
Location: rio

Poston Fri, 23 Nov 2007 3:02 pm

sera q the union/union all solves their problems
Code: Select all
     (select 'tabela_01' from dual) 
     union all
     (select 'tabela_02' from dual) 
     union all
     (select 'tabela_03' from dual)   
rodfbar
Location: Batatais - SP

Poston Fri, 23 Nov 2007 3:03 pm

Hey Carlos, beleza?

man, there's way, but the fields of the 4 tables that you will consult must be of the same type. What is the name of the tables and fields that you need to consult?

[] 's
Tineks
Location: Araraquara - SP

Cristiano (Tineks)
Araraquara - SP

Poston Mon, 26 Nov 2007 8:10 am

the cmpos are as follows: this is a sample: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1 table name varchar (50) end varchar (50) value (varchar 10) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 2 table name varchar (50) end varchar (50) value (varchar 10) wanted to appear the two table one another's side and added the value of 2 separately
carlos12
Location: rio

Poston Mon, 26 Nov 2007 8:24 am

Oops, what's up??

so, displays on one line the sum of 2 tables.

Code: Select all
SELECT A.VALOR_A,
       B.VALOR_B
  FROM (SELECT SUM(VALOR) VALOR_A
          FROM TABELA_A) A,
       (SELECT SUM(VALOR) VALOR_B
          FROM TABELA_B) B
would that be??

[] 's
Tineks
Location: Araraquara - SP

Cristiano (Tineks)
Araraquara - SP

Poston Mon, 26 Nov 2007 8:27 am

Cristiano brigadão by cra response tested here and gave certinho
carlos12
Location: rio



Return to SQL

Who is online

Users browsing this forum: No registered users and 1 guest