• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

uncleared on query result while applying left outer join

 
Ranch Hand
Posts: 83
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranch,
I am getting the following result while running the following query
select E.Lname As Employee_name,
S.Lname As Supervisor_name
from (EMPLOYEE As E left outer join EMPLOYEE As S
ON E.Super_ssn=S.Ssn)

Employee_name Supervisor_name
Smith Smith
Wong Wong
English English
Narayan Narayan
Borg Borg
Wallace Wallace
Jabbar Jabbar
Zelaya NULL


As per me result should be

Employee_name Supervisor_name
Smith Wong
Wong Borg
English Wong
Narayan Wong
Borg NULL
Wallace Borg
Jabbar Wallace
Zelaya Wallace

Employee table i am using

Fname Minit Lname Ssn Bdate Address Sex Salary Super_ssn Dno
John B Smith 123456789 1965-01-09 731 Fondren,Houston,TX M 30000.00 123456789 5
Franklin T Wong 333445555 1955-12-08 638 Voss,Houston,TX M 40000.00 333445555 5
Joyce A English 453453453 1972-07-31 5631 Rice,Houston,TX F 25000.00 453453453 5
Ramesh K Narayan 666884444 1962-09-15 975 Fire Oak,Humble,TX M 38000.00 666884444 5
James E Borg 888665555 1937-11-10 450 Stone,Houston,TX M 55000.00 888665555 1
Jennifer S Wallace 987654321 1941-06-20 291 Berry,Bellaire,TX F 43000.00 987654321 4
Ahmad V Jabbar 987987987 1969-03-29 980 Dallas,Huston,TX M 25000.00 987987987 4
Alicia J Zelaya 999887777 1968-01-19 3321 Castle,Spring,TX F 25000.00 NULL 4

kindly help on understanding the result of this .Fname
Thanks

 
incandescent light gives off an efficient form of heat. You must be THIS smart to ride this ride. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic