Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name abase1 dz pline
- acc 1 1 123.45
- acc 2 1 128.20
- acc 3 2 130.20
- acc 4 2 135.20
- name bbase1 chigh
- acc 1 128.20
- acc 2 130.25
- acc 3 145.20
- acc 4 128.05
- acc 5 148.20
- acc 6 149.50
- acc 7 148.70
- name abase1 pline bbase1 chigh
- acc 1 123.45 3 145.20
- acc 2 128.20 3 145.20
- acc 3 130.20 5 148.20
- acc 4 135.20 6 149.50
- select a.acc,a.abase1,a.pline,b.bbase1,b.chigh from table1 as a inner join table2 as b on a.name=b.name and a.abase1<b.bbase1 and a.pline <b.chigh
- select a.acc,a.abase1,a.pline,b.bbase1,b.chigh
- from table1 as a
- inner join table2 as b
- on a.name=b.name and a.abase1<b.bbase1 and a.pline <b.chigh
- left join table2 as c
- on c.name = a.name and a.abase1 < c.bbase1 and a.pline < c.chigh and b.bbase1 > c.bbase1 and b.chigh > c.chigh
- where c.bbase1 is null
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement