Advertisement
DimitarVasilev

Untitled

Jun 9th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.51 KB | None | 0 0
  1. SELECT names, name, creation_date
  2. FROM (SELECT name, creation_date, names, rownum rn
  3.   FROM (SELECT a.name, a.creation_date, u.first_name||' '||u.last_name names
  4.     FROM attach_doc a, gui_users u, file_content_type f
  5.     WHERE a.name NOT LIKE '%.jpg' AND a.name NOT LIKE '%.gif'
  6.     AND to_char(creation_date, 'YYYY')= to_char(sysdate, 'YYYY')
  7.     AND a.gui_user_id=u.gui_user_id
  8.     AND a.content_type_id=f.file_content_type_id
  9.     AND f.name NOT LIKE ('image%')
  10.     ORDER BY a.creation_date))
  11.     WHERE rn =2;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement