d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Sql Question? > Info Inside
Add Reply New Topic New Poll
Member
Posts: 1,849
Joined: May 31 2008
Gold: 2,571.50
May 4 2013 01:33pm
Code
CREATE VIEW deptinfo
 AS SELECT b.department_id, b.department_name, b.manager_id, b.location_id,ab.first_name || ' ' || ab.last_name AS manager_name
   FROM departments b LEFT OUTER JOIN employees ab
   ON b.manager_id = ab.employee_id
   ORDER BY b.manager_id;


Lets say im creating a view like this -- HOW do i change so that if there is no manager for a department -- it will say like ' no manager' ?

Ive been looking through my textbook and reading up on nvl, not null, etc... and even searching google but I still am left clueless -- any ideas?


ALSO sry if this wrong forums didnt see a SQL spot.

This post was edited by Noobtard on May 4 2013 01:33pm
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
May 4 2013 02:02pm
nvl(b.manager_id, 'no manager')

the subforums dont really matter tbh

This post was edited by carteblanche on May 4 2013 02:02pm
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll