0
こんにちはテーブルの4つのカラムを合計したいと思います。 私1つのテーブルで複数のフィールドを合計する
+------+------+------+------+------+
| id | col1 | col2 | col3 | col4 |
+======+======+======+======+======+
| 0002 | 5 | 5 | 5 | 5 |
+------+------+------+------+------+
| | | | | |
+------+------+------+------+------+
| | | | | |
+------+------+------+------+------+
$cost= DB::table('itemcost')
->select(
DB::raw('SUM(col1,col2,col3,col4) as unitprice')
);
エラーhe SUM function requires 1 argument(s)
itemcostテーブルを取得するには、事前にありがとうございます。