Popular posts from this blog
Inserting and Moving elements inside Ruby Array
By
Nishant Nigam
-
Here's is an array with 5 elements 2.1.2 :001 > arr = ["a", "b", "c", "d", "e"] => ["a", "b", "c", "d", "e"] Lets look at few different cases Insert a new element at starting position Using unshift 2.1.2 :002 > arr.unshift("f") => ["f", "a", "b", "c", "d", "e"] Using insert 2.1.2 :005 > arr.insert(0, "f") => ["f", "a", "b", "c", "d", "e"] In the above example 0 is the position(index) Move existing element from one position to another The element in this case is "e" Using uniq to show only unique elements 2.1.2 :009 > arr.insert(0, "e").uniq => ["e", "a", "b", "c", "d"] With uniq we are only showing unique records but the element is listed
Find duplicate records in ServiceNow
By
Nishant Nigam
-
Find duplicate records using GlideAggregate and groupBy var importGR = new GlideAggregate('u_import'); importGR.addAggregate('COUNT', 'u_number'); importGR.addNotNullQuery('u_number'); importGR.groupBy('u_number'); importGR.addHaving('COUNT', '>', 1); importGR.query(); while (importGR.next()) { gs.log(importGR.u_number); }
Comments
Post a Comment