Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 How to show all rows from views

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-06-28 : 10:37:20
writes "have created 2 views tb and tbss. I want to display e.fldlname,e.fldfname,e.fldmi,e.fldid,d.flddescr,t.flddate,t.flddateread,t.fldmmreact,t.fldclass and l.flddate(from view TBSS). Only few rows have common employee id (fldid). But I need all rows from both the views.

Please help me to sove this problem. Thank you very much for your time.

*************************************************************
create view tb as
select
e.fldlname,e.fldfname,e.fldmi,e.fldid,d.flddescr,t.flddate,t.flddateread,t.fldmmreact,t.fldclass

from employee e inner join tuber t on e.fldrec_num=t.fldemployee inner join dept d on d.fldcode =e.flddept

where e.fldcomp='UWMC' and

t.flddate >='2005-01-01' and
t.flddate <= '2005-05-31'
****************************************************************
Create view tbss as
select
e.fldlname,e.fldfname,e.fldmi,e.fldid,d.flddescr,l.flddate

from employee e inner join elog l on e.fldrec_num=l.fldemployee inner join dept d on d.fldcode =e.flddept

where l.fldcomp='UWMC' and l.fldtype ='TBSS' and

l.flddate >='2005-01-01' and
l.flddate <= '2005-05-31'
"

coolerbob
Aged Yak Warrior

841 Posts

Posted - 2005-06-28 : 11:07:10
Do a UNION SELECT
Go to Top of Page
   

- Advertisement -