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.
Author |
Topic |
n0i0x
Starting Member
5 Posts |
Posted - 2002-03-01 : 15:18:42
|
Hi I have the following code which lists the names of project contributors considered for a bonus and also the project leader also associated with the project. (empnin and pldrnin mean employee number and project leader number respectively)SELECT e.lastname, e.firstnameFROM employee e, contributor c, project pWHERE p.projno = c.projnoAND e.empnin = c.empninAND spent < (0.5 * budget)AND exfinish < '30-JUN-02'/SELECT e.lastname, e.firstnameFROM employee e, project pWHERE e.empnin = p.pldrninAND spent < (0.5 * budget)AND exfinish < '30-JUN-02'/ I was wondering if it is possible to link these two queries into 1?Please adviseThanks |
|
Jay99
468 Posts |
Posted - 2002-03-01 : 15:54:14
|
SELECT e.lastname, e.firstname, 'Mere-Mortal' as ContributorTypeFROM employee e, contributor c, project pWHERE p.projno = c.projnoAND e.empnin = c.empninAND spent < (0.5 * budget)AND exfinish < '30-JUN-02'UNIONSELECT e.lastname, e.firstname, 'Project Leader' as ContributorTypeFROM employee e, project pWHERE e.empnin = p.pldrninAND spent < (0.5 * budget)AND exfinish < '30-JUN-02'Jay |
|
|
|
|
|