Skip to content
Advertisement

SQL query to display Count of records based in range from another table

I have two tables Range and Employee.

Range table consists of columns

(Available programs for that salary like platinum and silver etc).

Employee table has columns

https://i.stack.imgur.com/RKaXP.png

enter image description here

I want to write a SQL query in such a way that it gets the count of employees who fall under the given salary range in range table, please refer screenshot for tables and result set.

Any help is appreciated. Thanks

Advertisement

Answer

You can join on inequality conditions:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement