Indigo Rose Software
  #1  
Old 02-04-2005
Josué Alba
Guest
 
Posts: n/a
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?
Reply With Quote
  #2  
Old 02-04-2005
Derek's Avatar
Derek Derek is offline
Indigo Rose Customer
 
Join Date: May 2001
Location: 51.501296|-2.700963
Posts: 1,206
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?
__________________
-
- Derek
- ["All glory comes from daring to begin" - fortune cookie]

IR WebHelp: AMS6 SUF7 VP2 TU2
Reply With Quote
  #3  
Old 02-04-2005
TJ_Tigger's Avatar
TJ_Tigger TJ_Tigger is offline
Indigo Rose Customer
 
Join Date: Sep 2002
Location: Sol 3
Posts: 3,188
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
Reply With Quote
  #4  
Old 02-04-2005
Josué Alba
Guest
 
Posts: n/a
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?
Reply With Quote
  #5  
Old 02-06-2005
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,059
Josué, I like your new avatar, by the way!

__________________
Intrigued
www.amsuser.com
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


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.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software