I have a table1 like below, table1 is very huge
Col1 Col2
A 1
B 5
A 7
Col3 Col4 Col5
0 2 x
4 5.5 y
6 7.5 z
where table1.col2 is between table2.col3 and table2.col4
Col1 Col2 Col5
A 1 x
B 5 y
A 7 z
You need INNER JOIN
with BETWEEN
as join
condition
SELECT t1.col1,
t1.col2,
t2.col5
FROM table1 t1
JOIN table2 t2
ON t1.col2 BETWEEN t2.col3 AND t2.col4
Note : you have mentioned where table1>>col2 is between table2>>col4 and table2>>col5 but it should be where table1>>col2 is between table2>>col3 and table2>>col4