Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Views- Creating Multi Table View

Status
Not open for further replies.

miked123

Programmer
Nov 9, 2001
38
US
I have a Call-Log Table and 5 Child Call-Type Tables.
The Call-Type Tables DO NOT have a Call_Type Column.
Need to add a Call_Type Column to the View AND assign a call_type identifier 1..5. I can then Group By Call_Date,Call_Type,Call_Person or what ever.
I can then use a Case ... When statement to join similar data columns into one column.

Struggling NOT to add the redundant data to the base tables.
Thanks.
 
create view v1
as select *,1 call_type from parenttab p,childtab1 c
where p.keyfield=c.childkey

create view v2
as select *,2 call_type from parenttab p,childtab2 c
where p.keyfield=c.childkey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top