Skip to content

SQL: negative numbers surrounded by round brackets are not treated as negative #48009

Closed
@astefan

Description

@astefan

SELECT TRUNCATE(-1.5), TRUNCATE(-(1.5)), -(1.5)

TRUNCATE(-1.5) |TRUNCATE(-(1.5))|      1.5      
---------------+----------------+---------------
-1.0           |1.0             |1.5            

While the result should be obvious, in case it isn't -(1.5) seems to evaluate in the end to 1.5.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions