Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with Rep as(
- select a.*, ceil(L/10000)*10000+n*10000 key_
- from repeats a,
- generate_series(0, (ceil((R-L) / 10000)+1)::int) g(n)
- where n<=(ceil((R-L) / 10000)+1) and R >= ceil(L/10000)*10000+n*10000
- ),
- Gen as (
- select a.*, ceil(L/10000)*10000+n*10000 key_
- from genes a,
- generate_series(0, (ceil((R-L) / 10000)+1)::int) g(n)
- where n<=(ceil((R-L) / 10000)+1) and R >= ceil(L/10000)*10000+n*10000
- )
- insert into result
- select t.L, t.R, t.cnt, G.name, R.name
- from Rep R, Gen G, t47k t
- where ceil(t.r/10000)*10000=R.key_ and t.r between R.l and R.r
- and ceil(t.l/10000)*10000=G.key_ and t.l between G.l and G.r
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement