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 (169)
  • MariaDB (424)
  • Microsoft Access (17)
  • MongoDB (265)
  • MySQL (602)
  • NoSQL (8)
  • Oracle (301)
  • PostgreSQL (480)
  • Redis (210)
  • SQL (697)
  • SQL Server (1,170)
  • SQLite (300)

Category: SQLite

6 Ways to Delete Duplicate Rows that have a Primary Key in SQLite

Posted on April 14, 2022 by Ian

Below are six examples that delete duplicate rows from a table in SQLite when those rows have a primary key or unique identifier column.

In these instances, the primary key must be ignored when comparing duplicates (due to the fact that primary keys prevent duplicate rows by definition).

Continue reading →
SQLite how to

2 Ways to Enable Word Wrap in SQLite

Posted on April 13, 2022 by Ian

When using one of SQLite’s tabular output modes, you can enable the --wrap option in order to limit the width of each column. This can be handy when the data contains long lines of text.

When we do this, we have the option of specifying “word wrap”, so that words don’t get cut off halfway through.

There are two ways to specify word wrap: use --wordwrap on or its shortcut -ww.

Continue reading →
SQLite how to

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

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

Add Days to a Date in SQLite

Posted on April 7, 2022 by Ian

In SQLite, we can use the DATE() function to add a given number of days to a date.

If we’re dealing with datetime values, we can use the DATETIME() function.

Continue reading →
SQLite dates, how to

nullvalue: Show NULL Values in SQLite

Posted on April 6, 2022 by Ian

When using the SQLite command line interface (CLI), by default, whenever a query returns a null value, the output is the empty string ('').

We can change this by using the -nullvalue command line option when launching SQLite.

We can also use the .nullvalue dot command if we’re already in the SQLite CLI.

Continue reading →
SQLite how to

JSON Functions & Operators in SQLite (Full List)

Posted on April 5, 2022 by Ian

Below is a full list of JSON functions and JSON operators available in SQLite.

Continue reading →
SQLite functions, json, reference

How to Convert to Uppercase in SQLite

Posted on April 4, 2022 by Ian

In SQLite we can use the upper() function to convert lowercase characters to uppercase.

Continue reading →
SQLite how to

2 Ways to Return the Julian Day in SQLite

Posted on April 4, 2022 by Ian

Here are two methods for returning the Julian Day in SQLite.

The Julian Day is the fractional number of days since noon in Greenwich on November 24, 4714 B.C. It’s the continuous count of days since the beginning of the Julian period, and is used primarily by astronomers, and in software for easily calculating elapsed days between two events.

Continue reading →
SQLite dates, how to
  • «
  • 1
  • …
  • 10
  • 11
  • 12
  • 13
  • 14
  • …
  • 30
  • »

About Database.Guide | Privacy Policy