Skip to content

SQL Bits

You're here to find quick SQL recipes.

  • Home
  • Topics
    • Generic SQL
    • PostgreSQL
    • MariaDB
    • MySQL
    • Oracle
    • SQL Server
    • Db2
    • Informix
    • SQLite
  • Advertising
  • Write
  • About

Category: Informix

Informix: Select NULL explicitly

Sometimes we want to extract a literal value with a SELECT. This works perfectly fine if the literal value is 1 or 'a', but it fails with an error if the value is NULL. Let’s discuss why and how to solve the problem.

Continue reading Informix: Select NULL explicitly
Published August 21, 2021
Categorized as Informix Tagged level-beginner

Find the maximum text length in a column

How to get the length of the longest text in a column. Including Db2 specific syntax.

Continue reading Find the maximum text length in a column
Published July 24, 2021
Categorized as Db2, Generic SQL, Informix, MariaDB, Oracle, PostgreSQL, SQL Server Tagged level-beginner

Grouping rows by a range of values

GROUP BY allows us to group identical values to aggregate data. What is not obvious is that it can be easily used to group values that belong to the same range, as well.

Continue reading Grouping rows by a range of values
Published July 24, 2021
Categorized as Generic SQL, Informix Tagged level-intermediate

Create a cross-table unique ID

Most tables are created with a unique, progressive ID. But how to create an ID whose values are unique across multiple tables? For example, if value 1 is in table A, it must not be in table B.

Continue reading Create a cross-table unique ID
Published July 23, 2021
Categorized as Db2, Generic SQL, Informix, MariaDB, Oracle, PostgreSQL, SQL Server Tagged level-intermediate
  • Twitter
  • Email
SQL Bits
Proudly sponsored by Vettabase.