1

Topic: To eliminate from sampling of record of other table

Good afternoon!
Prompt, please, who faced.
There are two tables:
t1
id, Number
7, 244
7, 245
7, 262
7, 249
7, 256
7, 247
.....
t2
id, Diapazon_c, Diapazon_po
7, 245, 246
7, 248, 250
7, 255, 260
How to select all records t1 which do not get to ranges t2?
That is as a result we should receive records:
id, Number
7, 244
7, 262
7, 247

2

Re: To eliminate from sampling of record of other table

Arl;
NOT EXISTS ()

3

Re: To eliminate from sampling of record of other table

Thanks. And can is more detailed, on my example, and that I do not represent while how to apply.

4

Re: To eliminate from sampling of record of other table

Arl wrote:

Thanks. And can is more detailed, on my example, and that I do not represent while how to apply.

It is bases. It is necessary to learn the alphabet.

SELECT *
FROM t1
WHERE NOT EXISTS
(
SELECT *
FROM t2
WHERE t2.id=t1.id
AND t1. Number BETWEEN t2. _c AND t2. _
);

5

Re: To eliminate from sampling of record of other table

Thanks, Gradually I study.