|
#1
|
|||
|
|||
|
SQL help.
Hi, I'm haing some SQL problems, the background is the following:
I have a employee tamble where I have a identificator named manager_id the problem is that not all of the employees has a manager so some of them has a null value in there and when making a join it only shows me the employees where there is a Manager. Some of you know how can I obtain all the employees even when they don't have a manager? |
|
#2
|
||||
|
||||
|
How are you currently returning the results? Can you paste some code here so we can see what you are accessing and how the syntax is written, please?
|
|
#3
|
||||
|
||||
|
What about filling the NULL fields with a "0" as SQLite starts autonumbering at 1 you can use "0" to represent no manager. You would then have to add the manager of ID 0 to your manager table, but at least all data should be returned.
Tigg
__________________
TJ-Tigger "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools." "Draco dormiens nunquam titillandus." Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine |
|
#4
|
|||
|
|||
|
select d.department_name, e.first_name || e.last_name
from departments d, employees e where e.employee_id = d.manager_id (+) select d.department_name, e.first_name || ' ' || e.last_name from departments d left outer join employees e on ( e.employee_id = d.manager_id) this was the code, many thanx. Another question some one knows how is the Boyce Codd normalize form? |
|
#5
|
||||
|
||||
|
Josué, I like your new avatar, by the way!
|
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SQL Lite | Roboblue | AutoPlay Media Studio 5.0 | 1 | 11-20-2004 04:30 PM |
| SQL - Helpful link | Intrigued | Developer's Den | 2 | 09-07-2004 04:09 PM |
| SQL - Easy does it | Intrigued | AutoPlay Media Studio 5.0 | 0 | 08-22-2004 10:48 PM |
| selecting sql server | necabettin | Setup Factory 6.0 | 1 | 05-13-2004 10:20 PM |
| MS SQL Server 7.0 Installs | swdevlin | Setup Factory 6.0 | 3 | 06-10-2003 02:51 PM |
All times are GMT -6. The time now is 03:46 AM.








Linear Mode

