I am setting up a view that pulls from two other views. I want to return the records from both views based on 1 common field but I end up with the Catesian product of these records
There are two valid records in each table
This Returns
Bus_id Room Night Singles Booking Id Event_Start_Dat e Lunch
81380----18/02/08------10------ 81380----19/02/08---------150
81380----18/02/08------10------ 81380----20/02/08---------163
81380----19/02/08------16------ 81380----19/02/08---------150
81380----19/02/08------16------ 81380----20/02/08---------163
What I want it to return is
Bus_id Room Night Singles Booking Id Event_Start_Dat e Lunch
81380----18/02/08-------10-------Null--------Nul----------------Null
Null--------Null-------------Null-----81380-----20/02/08--------163
81380----19/02/08-------16-------81380-----19/02/08--------150
I have been trying every combination of joins but seem to missing something.
I would appreciate anyones help
There are two valid records in each table
Code:
SELECT dbo.Delphi_Forecast_Rooms.BUS_ID, dbo.Delphi_Forecast_Rooms.[Room Night], dbo.Delphi_Forecast_Rooms.Singles, dbo.Delphi_Forecast_FB.[Booking ID], dbo.Delphi_Forecast_FB.Event_Start_date, dbo.Delphi_Forecast_FB.Lunch FROM dbo.Delphi_Forecast_Rooms FULL OUTER JOIN dbo.Delphi_Forecast_FB ON dbo.Delphi_Forecast_Rooms.BUS_ID = dbo.Delphi_Forecast_FB.[Booking ID] WHERE (dbo.Delphi_Forecast_Rooms.BUS_ID = 81380)
Bus_id Room Night Singles Booking Id Event_Start_Dat e Lunch
81380----18/02/08------10------ 81380----19/02/08---------150
81380----18/02/08------10------ 81380----20/02/08---------163
81380----19/02/08------16------ 81380----19/02/08---------150
81380----19/02/08------16------ 81380----20/02/08---------163
What I want it to return is
Bus_id Room Night Singles Booking Id Event_Start_Dat e Lunch
81380----18/02/08-------10-------Null--------Nul----------------Null
Null--------Null-------------Null-----81380-----20/02/08--------163
81380----19/02/08-------16-------81380-----19/02/08--------150
I have been trying every combination of joins but seem to missing something.
I would appreciate anyones help
Comment