Home > OS >  Pulling information from two database tables
Pulling information from two database tables

Time:10-30

enter image description here

enter image description here

So, what I want to do with these tables is sort employee names and department names by salary, but they are on seperate tables, so I assume I have to somehow use the WORKDEPT column and connect it to the DEPT table, but I'm not really sure how.

CodePudding user response:

Why not use something like this?

SELECT * FROM tabA JOIN tabB ON tabA.DEPTNO = tabB.WORKDEPT ORDER BY salary
  •  Tags:  
  • sql
  • Related