PostgreSQL – >= Operator
The greater than or equal to operator is denoted by >=
. This operator is used to compare two values and returns true
if the left operand is greater than or equal to the right operand; otherwise, it returns false
.
Here’s the general syntax of using the greater than or equal to operator in PostgreSQL:
value1 >= value2
For example, if you have a table named scores
with columns student_id
and score
, and you want to retrieve all records where the score is greater than or equal to 80, you would use the following SQL query:
SELECT * FROM scores WHERE score >= 80;
This query would fetch all rows from the scores
table where the score
column has a value of 80 or higher.
The >=
operator can be used with various data types, including numeric, date, and timestamp types, as long as the comparison makes sense for the given data types.