Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. select max(n) + 1 as letra_sig from (select
  2. case when substring(t.nro_ht from 11) = '' or substring(t.nro_ht from 11) similar to '[A-Z]' then 0
  3. when substring(t.nro_ht from 11) is not null or substring(t.nro_ht from 11) not similar to '[A-Z]' then substring(t.nro_ht from 11)::int end
  4. as n
  5. from tbl_hojatramite t where substring(t.nro_ht,1,9) ='201945098' order by n) as tbl_copias
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement