May 27, 2011 at 3:47 am
I have several tables with same columns and i want to extract same information from all tables.
can i do it using one query
May 27, 2011 at 4:10 am
It's quite a vague requirement. Can you post:
1. Table definition (create table sql script)
2. Sample data (insert into ... values)
3. Desired output
Without this information I can only give a vague answer:
SELECT SomeColumns
FROM FirstTable
UNION --(ALL ??)
SELECT SomeColumns
FROM SecondTable
-- Gianluca Sartori
May 27, 2011 at 4:11 am
yes you can,
use a JOIN , either INNER, or LEFT or RIGHT depending on the requirements.
Check Books on line for the Syntax
May 27, 2011 at 4:19 am
same information and same columns
Union is a solution,normalize the structure then you can apply joins
Regards,
Syed Jahanzaib Bin Hassan
BSCS | MCTS | MCITP | OCA | OCP | OCE | SCJP | IBMCDBA
My Blog
www.aureus-salah.com
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply