I
I
Igor Bezlepkin2019-11-12 12:22:32
Yii
Igor Bezlepkin, 2019-11-12 12:22:32

How to make a query with a condition where two dates are the same?

Hey! You need to make a request like this.
SELECT * FROM user WHERE created_at = updated_at

$query = User::find()
  ->filterWhere(['=', 'created_at', 'updated_at'])
  ->all();

It doesn't work like that

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis A., 2019-11-12
@Bezlepkin

User::find()
  ->where('created_at=updated_at')
  ->all();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question