Skip to content

Instantly share code, notes, and snippets.

@searock
searock / gist:ce7d221b00789ae6c8ee69b7f56ed90c
Created Jul 12, 2018
Querying origin and destination location in mongoDB
View gist:ce7d221b00789ae6c8ee69b7f56ed90c
//class
var package = function (packageName, originLatitude, originLongitude,
destinationLatitude, destinationLongitude) {
return {
packageName : packageName,
origin : { type : "Point", coordinates: [originLatitude, originLongitude]},
destination : { type : "Point", coordinates: [destinationLatitude, destinationLongitude]}
};
};
@searock
searock / duplicate.sql
Last active Jul 11, 2018
Search for duplicate values in a table.
View duplicate.sql
select column_name, count(column_name)
from table
group by column_name
having count (column_name) > 1;
@searock
searock / pagination.sql
Created Dec 9, 2015
Oracle pagination query
View pagination.sql
SELECT *
FROM (SELECT R.*, ROWNUM RNUM, COUNT(*) OVER () RESULT_COUNT
FROM (SELECT i.ITEM_CODE, i.ITEM_NAME
FROM TBL_ITEMS i) R)
WHERE RNUM between 0 and 9 ;