HI ALL,
I have posted this same question before but I couldn't find my thread.
This is my data that I am trying to query.
data:
col_a col_b col_c
3 13127 100
1 13127 101
4 13127 102
10 13127 104
1 13128 100
5 13128 101
6 13128 102
SELECT a.*
FROM table_x a, table_x b
WHERE
a.col_b = b.col_b
AND (a.col_c - b.col_c) > 1;
Result:
col_a col_b col_c
4 13127 102
10 13127 104
10 13127 104
10 13127 104
6 13128 102
As u can see the query is repeating more than once. Can you tell why?
Many thanks.
I have posted this same question before but I couldn't find my thread.
This is my data that I am trying to query.
data:
col_a col_b col_c
3 13127 100
1 13127 101
4 13127 102
10 13127 104
1 13128 100
5 13128 101
6 13128 102
SELECT a.*
FROM table_x a, table_x b
WHERE
a.col_b = b.col_b
AND (a.col_c - b.col_c) > 1;
Result:
col_a col_b col_c
4 13127 102
10 13127 104
10 13127 104
10 13127 104
6 13128 102
As u can see the query is repeating more than once. Can you tell why?
Many thanks.