Saturday, 17 August 2013

SQL - compare a non related table

SQL - compare a non related table

Need to retrieve information from 2 tables that are not related on a sql
db. Basically i need to view the name, salary AND salary_grade, according
to lower_bound or upper_bound.
table A:
name
salary
Table B:
salary_grade
lower_bound
upper_bound
For example John has a salary of $1000
{salary_grade, lower bound, upper bound}: {1, 800, 999}, {2, 1000, 1200} ...
so this view would bring fields "John" + "1000" + "2". As you see there is
no foreign key or way to relate both tables and i'm struggling to find out
a function to relate em.
Thanks in advance.

No comments:

Post a Comment