I am trying to join two tables using Inner join in SQL.

I am using following code:

#####################

SELECT * FROM table1

INNER JOIN table2

ON table1.a = table2.a

WHERE table1.b BETWEEN table2.b1 AND table2.b2

####################

I am getting repetition in output because table1.b is present between multiple records of table2.b1 and table2.b2

What additional code should be used to keep only the first matching record in "between" operator?

More Muhammad Faisal Habib's questions See All
Similar questions and discussions