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

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -