Database.Guide

Skip to content

Beginners

  • What is a Database?
  • Database Tutorial

SQL

  • SQL Tutorial
  • SQL Reference
  • SQL Joins Tutorial
  • SQL Transactions Tutorial
  • Basic SQL Queries

Categories

  • Azure SQL Edge (17)
  • Database Concepts (99)
  • Database Tools (72)
  • DBMS (9)
  • DuckDB (141)
  • MariaDB (424)
  • Microsoft Access (17)
  • MongoDB (265)
  • MySQL (602)
  • NoSQL (8)
  • Oracle (301)
  • PostgreSQL (480)
  • Redis (210)
  • SQL (697)
  • SQL Server (1,169)
  • SQLite (298)

Author: Ian

Difference Between -> and ->> in SQLite

Posted on April 12, 2022 by Ian

The -> and ->> operators were introduced in SQLite version 3.38.0, which was released on 22 February 2022. Both operators are used for extracting subcomponents of JSON. But there’s a subtle difference between them.

Continue reading →
SQLite json, what is

Get the Number of Days in a Month in PostgreSQL

Posted on April 12, 2022 by Ian

Here’s an example of using PostgreSQL to return the number of days in a month, based on a given date.

Continue reading →
PostgreSQL dates, how to, psql

UPPER() – Convert to Uppercase in PostgreSQL

Posted on April 11, 2022 by Ian

In PostgreSQL, we can use the upper() function to convert lowercase characters to their uppercase equivalent, according to the rules of the database’s locale.

Continue reading →
PostgreSQL functions, how to, psql, what is

LOWER() – Convert to Lowercase in PostgreSQL

Posted on April 11, 2022 by Ian

In PostgreSQL, we can use the lower() function to convert uppercase characters to their lowercase equivalent, according to the rules of the database’s locale.

Continue reading →
PostgreSQL functions, how to, psql, what is

Get the First Day of the Month in PostgreSQL

Posted on April 10, 2022 by Ian

We can use the following method in PostgreSQL to return the first day of a given month.

This could be the first day of the current month, or the first day of the month based on a date that we specify.

Getting the first day of the month allows us to perform further calculations on the resulting date, like adding a certain number of days to the start of the month, etc.

Continue reading →
PostgreSQL dates, how to, psql

2 Ways to Return Rows that Contain Only Non-Alphanumeric Characters in MySQL

Posted on April 10, 2022 by Ian

Below are two options for finding those rows that only contain non-alphanumeric characters in MySQL.

Non-alphanumeric characters include punctuation characters like !@#&()–[{}]:;',?/* and symbols like `~$^+=<>“, as well as whitespace characters like the space or tab characters.

Continue reading →
MySQL how to

Add Hours to a Time Value in PostgreSQL

Posted on April 9, 2022 by Ian

In PostgreSQL, we can use the + operator to add one or more hours to a time value.

By “time” value, this could be an actual time value, a timestamp, or an interval. We can also add hours to a date value or a date and time combination.

Continue reading →
PostgreSQL dates, how to, psql

Fix Error: “SELECTs to the left and right of UNION do not have the same number of result columns” in SQLite

Posted on April 9, 2022 by Ian

If you’re getting “Error: in prepare, SELECTs to the left and right of UNION do not have the same number of result columns…” in when trying to use the UNION operator in SQLite, it’s because one of the SELECT statements is returning more columns than the other.

Continue reading →
SQLite errors, how to, operators

Calculate the Number of Seconds Since a Particular Date/Time in SQLite

Posted on April 8, 2022 by Ian

If you need to calculate the number of seconds that have passed since a given date and time, you can use the UNIXEPOCH() function.

Note that this function was introduced in SQLite 3.38.0, so it will only work if you’re using SQLite 3.38.0 or later.

Continue reading →
SQLite dates, how to

INITCAP() – Convert to Initial Caps in PostgreSQL

Posted on April 8, 2022 by Ian

In PostgreSQL, we can use the initcap() function to format a string of text to use initial capitals. That is, it converts the first letter of each word to upper case and the rest to lower case.

Continue reading →
PostgreSQL functions, how to, psql, what is
  • «
  • 1
  • …
  • 140
  • 141
  • 142
  • 143
  • 144
  • …
  • 389
  • »

About Database.Guide | Privacy Policy