FLOOR Function - SQL Server to PostgreSQL Migration

In SQL Server and PostgreSQL, the FLOOR function rounds down the specified number to the nearest integer value.

SQL Server and PostgreSQL:

  -- Round to the nearest smaller integer
  SELECT FLOOR(123.4);
  /* 123 */  
 
  -- Still rounds to smaller integer even if it is closer to larger integer
  SELECT FLOOR(123.9);
  /* 123 */

For more information, see SQL Server to PostgreSQL Migration.