sql >> Databáze >  >> RDS >> Mysql

Laravel Query Builder – Jak mohu sečíst?

$monthDurations = $user->times()
    ->whereYear('start_day', 2019)
    ->select(
        \DB::raw('SUM(TIME_TO_SEC(duration)) as `month_duration_in_seconds`'),
        \DB::raw('DATE_FORMAT(start_day, "%Y-%m") as `year_month`'),
        'category',
        'user_id'
    )
    ->groupBy(\DB::raw('DATE_FORMAT(start_day, "%Y-%m")'), 'category', 'user_id')
    ->get();


  1. docker-compose:pokaždé znovu inicializuje databázi MySQL

  2. MariaDB UCASE() Vysvětleno

  3. Nelze importovat MySQLdb - python - Windows 8.1

  4. Nové standardní velikosti vrstev Azure SQL Database