Row Expressions
Syntax:
row_constructor operator row_constructor
Both sides are a row constructor. The values of two rows must have the same number of fields. Each row is compared. Operators such as =, <>, <, <=, and >= or a semantically equivalent operator can be used for row comparison.
The usage of <> differs slightly from other operators. If all fields of both rows are non-null and equal, the two rows are considered equal. If any field of the two rows is non-null and unequal, the two rows are considered unequal. Otherwise, the comparison result is unknown (null).
For operators <, <=, >, and >=, elements in a row are compared from left to right until a pair of unequal elements or a pair of null elements is encountered. If there is at least one null value in the pair of elements, the comparison result is unknown (null). Otherwise, the comparison result of the pair of elements is the final result.
Example:
1 2 3 4 5 |
postgres=#SELECT ROW(1,2,NULL) < ROW(1,3,0) AS RESULT; result ---------- t (1 row) |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot