M
M
MikMik2020-07-20 23:38:46
Yii
MikMik, 2020-07-20 23:38:46

Why is the data not output via CONCAT?

Tell me why data may not be displayed via CONCAT

$query = self::find()->select(['id', 'CONCAT(name, sname) AS fname'])->all();


Separately (without concat) all fields are displayed, but with concat - id is displayed and fname is not.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael, 2020-07-23
@Nolan81

$query = self::find()->select(['id', new \yii\db\Expression('CONCAT(name, sname) AS fname')])->all();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question