Results of 1 - 7 of about 7 for rounding (0.002 sec.)
- Numeric Functions 11996
- Numeric Operators The table below shows the available mathematical operators for numeric types . Operator Description Example Result + Addition 2 + 3 5 - Subtraction 2 - 3 -1 * Multiplication 2 * 3 6 / Float division 5 / 2 2.5 // Division 5
...g a DECIMAL . degrees(x) Converts radians to degrees. divide(x, y) Alias for x // y . even(x) Round to next even number by rounding away from zero. exp(x) Computes e ** x . factorial(x) See the ! operator. Computes the product of the current integer and...range 0.0 <= x < 1.0 . round_even(v NUMERIC, s INTEGER) Alias of roundbankers(v, s) . Round to s decimal places using the rounding half to even rule . Values s < 0 are allowed. roundbankers(v NUMERIC, s INTEGER) Alias of round_even(v, s) . Round to s de...cimal places using the rounding half to even rule . Values s < 0 are allowed. round(v NUMERIC, s INTEGER) Round to s decimal places. Values s < 0 are allo... - https://man.mtool.work/duckdb/2.0/sql/functions/numeric.html
- Numeric Types 10723
- Fixed-Width Integer Types The types TINYINT , SMALLINT , INTEGER , BIGINT and HUGEINT store whole numbers, that is, numbers without fractional components, of various ranges. Attempts to store values outside of the allowed range will result
...lue, use the uuid_extract_timestamp function : SELECT uuid_extract_timestamp(uuidv7()) AS ts; ts 2025-04-19 15:51:20.07+00 Rounding Casting from floating-point or fixed-point types to integers means that the source numbers are rounded. The following defa...ult rounding logic applies: Casting from FLOAT and DOUBLE to integers of any size: round to the nearest integer, with ties (halfs) roun...ded to the nearest even number ( banker's rounding ). sql SELECT 2.5::FLOAT::INTEGER AS result; -- round to even text ┌────────┐ │ result │ │ int32 │ ├────────┤ │ 2 │ └─────... - https://man.mtool.work/duckdb/2.0/sql/data_types/numeric.html
- Casting 10214
- Casting refers to the operation of converting a value in a particular data type to the corresponding value in another data type. Casting can occur either implicitly or explicitly. The syntax described here performs an explicit cast. More in
...ing from VARCHAR to any other type, the string will be attempted to be converted. Casting between numeric types might have rounding implications. The applicable rounding rules can be found on the NUMERIC type page . TRY_CAST TRY_CAST can be used when the... - https://man.mtool.work/duckdb/2.0/sql/expressions/cast.html
- Samples 8669
- Samples are used to randomly select a subset of a dataset. Examples Select a sample of exactly 5 rows from tbl using reservoir sampling: SELECT * FROM tbl USING SAMPLE 5; Select a sample of approximately 10% of the table using system sampli
...ercentage of the number of rows, but it is much less likely that you get no rows at all. To get exactly 10% of rows (up to rounding), you must use the reservoir sampling option. Select a sample of approximately 10% of the table using bernoulli sampling:...SELECT * FROM tbl USING SAMPLE 10 PERCENT (bernoulli); Select a sample of exactly 10% (up to rounding) of the table using reservoir sampling: SELECT * FROM tbl USING SAMPLE 10 PERCENT (reservoir); Select a sample of exactly... - https://man.mtool.work/duckdb/2.0/sql/samples.html
- Sharing Macros 8160
- DuckDB has a powerful macro mechanism that allows creating shorthands for common tasks. Sharing a Scalar Macro First, we define a macro that pretty-prints a non-negative integer as a short string with thousands, millions, and billions (with
...out rounding) as follows: duckdb pretty_print_integer_macro.duckdb CREATE MACRO pretty_print_integer(n) AS CASE WHEN n >= 1_000_000_000... - https://man.mtool.work/duckdb/2.0/guides/snippets/sharing_macros.html
- Typecasting 6888
- Typecasting is an operation that converts a value in one particular data type to the closest corresponding value in another data type. Like other SQL engines, DuckDB supports both implicit and explicit typecasting. Explicit Casting Explicit
...ed. SELECT CAST(3.1 AS INTEGER); -- 3 SELECT CAST(3.5 AS INTEGER); -- 4 SELECT CAST(-1.7 AS INTEGER); -- -2 The applicable rounding rules can be found on the NUMERIC type page . Overflows Casting operations that would result in a value overflow throw an... - https://man.mtool.work/duckdb/2.0/sql/data_types/typecasting.html
- Aggregate Functions 6888
- Examples Produce a single row containing the sum of the amount column: SELECT sum(amount) FROM sales; Produce one row per unique region, containing the sum of amount for each group: SELECT region, sum(amount) FROM sales GROUP BY region; Ret
...e arg is true . decimal_average(arg) Computes the average of a DECIMAL column using exact integer arithmetic with banker's rounding, returning a DECIMAL with the same width and scale as the input. favg(arg) Calculates the average using a more accurate fl...decimal_average(arg) | Description | Computes the average of a DECIMAL column using exact integer arithmetic with banker's rounding , returning a DECIMAL with the same width and scale as the input. NULL values are ignored. | | Example | decimal_average(A... - https://man.mtool.work/duckdb/2.0/sql/functions/aggregates.html
PREV
1
NEXT
DuckDB 2.0 Documentation / man.mtool.work