Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. u_a_id d_c_s c_nm c_seq r_c_p
  2. 1 908 Test1 1 20
  3. 10 908 Test1 1 21
  4. 11 908 Test1 1 12
  5. 12759 908 Test1 1 31
  6. 12759 908 Test1 1 32
  7. 12861 878 Test2 1 43
  8. 12861 878 Test2 1 44
  9.  
  10. select u_a_id, d_c_s, c_nm, c_seq, count(*) cnt, min(r_c_p) min_rcp, max(r_c_p) max_rcp
  11. from table1
  12. where c_nm not in ('VOID', 'WRONG')
  13. group by u_a_id, d_c_s, c_nm, c_seq
  14. having count(*) > 1;
  15.  
  16. u_a_id d_c_s c_nm c_seq r_c_p
  17. 1 908 Test1 1 20
  18. 10 908 Test1 1 21
  19. 11 908 Test1 1 12
  20. 12759 12908 Test1 - 1 1 31
  21. 12759 12908 Test1 - 2 1 32
  22. 12861 12878 Test2 - 1 1 43
  23. 12861 12878 Test2 - 2 1 44
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement