Skip to content

Instantly share code, notes, and snippets.

ps -ef | grep 'proccess name' | awk '{print $2}' | xargs -r kill
@jazz7381
jazz7381 / get-duplicate.sql
Created December 24, 2021 07:10
Get data all duplicate except the first data PostgreSQL
SELECT * FROM tablename
WHERE id IN (SELECT id
FROM (SELECT id,
ROW_NUMBER() OVER (partition BY column1, column2 ORDER BY id) AS rnum
FROM tablename) t
WHERE t.rnum > 1);
@jazz7381
jazz7381 / delete-duplicate.sql
Last active December 24, 2021 07:08
Remove duplicate data and leave data with less ID from PostgreSQL
DELETE FROM tablename
WHERE id IN (SELECT id
FROM (SELECT id,
ROW_NUMBER() OVER (partition BY column1, column2 ORDER BY id) AS rnum
FROM tablename) t
WHERE t.rnum > 1);
function tattoo_submit() {
if (isset($_POST["addtattoo"])) {
$title = "Tattoo : ". $_POST["tatooInput"];
$my_post = array(
'post_title' => $title,
'post_status' => 'publish',
'post_author' => 1,