Advertisement
DimitarVasilev

Untitled

Jun 9th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.45 KB | None | 0 0
  1. SELECT names, name, creation_date
  2. FROM (SELECT t1.*, 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 to_char(creation_date, 'YYYY')= to_char(sysdate, 'YYYY')
  6.     AND a.gui_user_id=u.gui_user_id
  7.     AND a.content_type_id=f.file_content_type_id
  8.     AND f.name NOT LIKE ('image%')
  9.     ORDER BY a.creation_date) t1
  10.     WHERE rownum<=2)
  11.     WHERE rn =2;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement