my personal dot files, snippets and others things

View the Project on GitHub 69pmb/DotFiles

Database

PostgreSQL

select date_part('year', creation_date) AS txn_year, date_part('month', creation_date) AS txn_month, count(*) as monthly_sum from table group by txn_year, txn_month order by monthly_sum desc;`
WITH unnested AS ( SELECT jsonb_array_elements(metadata -> 'failed') AS element FROM permissions where creation_date > '2025-12-01') SELECT element ->> 'executor_ref' AS executor_ref, COUNT(*) AS occurrence FROM unnested WHERE element ->> 'project_ref' = 'sdoscsp' GROUP BY executor_ref;

MySql

UPDATE CONFIGURATION_ADMINISTRATION_DATABASECHANGELOGLOCK
SET LOCKED=0, LOCKGRANTED=null, LOCKEDBY=null ;
DROP database db_name;
CREATE database db_name;