How to find the difference between two table in database without using join? -


i need find difference between highest salary table called myproject.faculty , highest salary table called myproject.staff. how can that?

sql query:

select * myproject.faculty 

result:

id  firstname   lastname    city    state   zip     salary  dept    birth_date  phone  102     jack    sue     frostburg   md  21532   109000  cosc        3016783232  1   jo  andorfer    aberdeen    md  21532   80000.89    cosc    01-feb-81   301-687-5678  

sql query:

select * myproject.staff 

result:

id  firstname   lastname    city    state   zip     salary  birth_date  phone  1   xin     zheng   aberdeen    md  21532   80000.89    01-feb-81   301-687-5678  2   gerri   wojnar  aberdeen    fl  33423   78000.25    22-jan-88   301-687-5679  

try following

select (select max(salary) myproject.faculty) - (select max(salary) myproject.staff) 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -