I have a column called BIRTH_DATE in my view. I want to calculate the age using that column and today’s date, and count the number of staff in an age bracket. For example: staff between 40 and 49 etc. Other answers in plain SQL statements are also welcome. My code is shown below: I am calculating the age as shown
Tag: yii2
Yii2 How to translate SUM SQL function to Query Builder?
I have this simple SQL query: SELECT product_name, SUM (product_amount) FROM orders GROUP BY product_name; It will show a list with product names and their amounts. Like this example: I want to …