In postgresql, I'd like to determine whether a known integer is within a +/- range of another integer. What is the function for this query?
Example: In my dataset, I have 2 Tables:
Table_1
ID integer
1 2000
2 3000
3 4000
Table_2
ID integer
1 1995
2 3050
3 4100
For each ID-pair, I'd like to query whether Table_1.integer is +/- 25 of Table_2.integer.
The answers would be:
ID 1: TRUE
ID 2: FALSE
ID 3: FALSE
Any help is much appreciated. I am new to using postgresql and all programming languages in general.
