Click to See Complete Forum and Search --> : Display data from various tables


shashibadari
November 12th, 2008, 09:38 PM
Hi,

I am trying to display the records from 2 different tables, eg: Receipts and Release. On some conditions i need to display from either one tables and sometimes from both.

Both the tables are identical except Table Release has one extra date field. Depending on some business logic i had to filter the records and put them in to a temp table, so i also need to read from that one.

My problem is when i have to print from both the tables, and if i use 2 select statements only the results of 1st select statement is displayed , how do i append the report with another selelct statement?

Eg: if(condition = false)
( select ... from Release join on .......)
else
(selelct .. from Receipts join on ....
select ... from Release join on ...)

On the second condition is where i have problem


Can some one please help me.

jggtz
November 13th, 2008, 12:36 PM
You could use UNION ALL clause