I have a simple query in DQL that selects 3 columns:
$qb->select("c.zip_code, c.name, s.state")
->where("c.zip_code LIKE :input");
My desired output is
"[c.zip_code], [c.name], [s.state]"
Currently, I'm concatenating strings on the PHP level to get the desired string.
Is it faster to do it on the database level by using the CONCAT() function?
This isn't really a point on which optimisation is relevant. You should be conserned with which one is more readable/practical, personally I would do it on PHP level.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With