java - Select query with outer join -


i have 2 tables files , employees.

files :

file_id| filename | modifiedby

   1      a.java        10    2      b.java        11 

employees:

id| name

10 rahul
11 priya
12 rohith

what trying is, print filenames , person modified file. have modifiedby persons'name table employee using employee id. if employeeid doesnot exist in employees table, must not throw error. asked using outer join. kindly in doing new topic

use query:

select f.filename, e.name  files f  left outer join employees e    on f.modifiedby = e.id 

the files table: (with extra, non existant modifiedby id)

files

the employees table:

employees

output:

output

edit:

since you're using oracle dbms, need drop as keyword:

select f.filename, e.name  files f  left outer join employees e    on f.modifiedby = e.id 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -