Yii2 Active Record How to write the query is greater than or equal?

Please tell me how to specify an SQL query to Active Record.
There is a table in which there is a field 'id'.
Need to get records where:
id >= 4
July 2nd 19 at 17:48
1 answer
July 2nd 19 at 17:50
Solution
MyModel::find()->where(['>','id',3])->one();
MyModel::find()->where(['>=','id',4])->one(); - margarita_Kreiger21 commented on July 2nd 19 at 17:53
: is >=4 is not the same as >3 from the point of view of mathematics? - Henderson_Beat commented on July 2nd 19 at 17:56
from the point of view of mathematics the same thing, but why split hairs with the incoming data, if there is a built-in operation? Most likely the magical number 4 in the code will not be used, instead, it is variable and then your form will look like MyModel::find()->where(['>','id',$id-1])->one(); what is not so obvious as MyModel::find()->where(['>=','id',$id])->one(); - margarita_Kreiger21 commented on July 2nd 19 at 17:59

Find more questions by tags Active RecordYiiMySQLPHP