Guest User

Untitled

a guest
Sep 28th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. +---------------+
  2. |abrahadabra.pdf|
  3. |---------------|
  4. |some.txt |
  5. |---------------|
  6. |Doc.docx |
  7. +---------------+
  8.  
  9. +------+
  10. |.pdf |
  11. |------|
  12. |.txt |
  13. |------|
  14. |.docx |
  15. +------+
  16.  
  17. SELECT ( SELECT (substr( d.DOC_FNAME, length(d.DOC_FNAME) - instr('.', d.DOC_FNAME)+1)) FROM dual) AS doctype
  18. FROM Documents d
  19. GROUP BY d.DOC_FNAME;
  20.  
  21. select substr(DOC_FNAME,-instr(reverse(DOC_FNAME),'.'))
  22. from table
  23.  
  24. select regexp_substr(DOC_FNAME,'.[^.]*$')
  25. from table
Add Comment
Please, Sign In to add comment