Useful tips for everyday
How do I count distinct values in a case statement in SQL? You can try this: select count(distinct tag) as tag_count, count(distinct (case when entryId…
What is PostgreSQL error? All messages emitted by the PostgreSQL server are assigned five-character error codes that follow the SQL standard’s conventions for “SQLSTATE” codes.…
How can I tell when a SQL Server backup was last restored? We get the following database restoration history in my environment. restore_date: It shows…
WHERE do we use on clause? The ON Clause makes code easy to understand. ON Clause can be used to join columns that have different…
How to select everything after a certain character in MySQL? Please use http://www.w3resource.com/mysql/string-functions/mysql-substring_index-function.php for further reference. Try this (it should work if there are multiple…
How to upgrade MySQL from 5.6 to 5.7? 2. Stop the mysql database and backup db files 2. Download the MySQL 5.7 RPM 3. Remove…
How do I make a column primary key and autoincrement in PostgreSQL? By simply setting our id column as SERIAL with PRIMARY KEY attached, Postgres…
How to create a partitioned table in PostgreSQL? Create measurement table as a partitioned table by specifying the PARTITION BY clause, which includes the partitioning…
How to backup and restore MySQL or MariaDB database? Let’s say we want to take the backup of mydb database and save it in a…
How do I move a RDS snapshot from one region to another? [SOLVED] how to copy/move AWS RDS to another Region Create a snapshot of…