Advertisement
Guest User

Untitled

a guest
May 26th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.   s.catalogue_code,
  3.   regexp_replace(s.catalogue_code, '[^0-9]+', '', 'g')
  4. FROM
  5.   stamp s
  6. WHERE
  7.   regexp_replace(s.catalogue_code, '[^0-9]+', '', 'g')::int BETWEEN 0 AND 100
  8. ORDER BY
  9.   naturalsort(s.catalogue_code) ASC
  10. ;
  11.  
  12.  
  13.  
  14.  
  15. SELECT
  16.   s.id,
  17.   c.acronym,
  18.   s.catalogue_code
  19. FROM stamp s
  20. inner join country c on s.country_id = c.id
  21. WHERE
  22.   s.catalogue_code ~ '^[^0-9]+$';
  23.  
  24.  
  25.  
  26.  
  27.  
  28. SELECT
  29.   s.catalogue_code,
  30.   regexp_replace(s.catalogue_code, '[^0-9]+', '', 'g')
  31. FROM
  32.   stamp s;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement