質問編集履歴

1

コードの部分をマークダウンに修正しました

2021/03/29 07:20

投稿

RS3110
RS3110

スコア3

test CHANGED
File without changes
test CHANGED
@@ -22,17 +22,29 @@
22
22
 
23
23
  〇作成した生のクエリ
24
24
 
25
+
26
+
27
+
28
+
29
+ ```SQL
30
+
25
31
  SELECT payment, count(payment) AS num, sum(price) AS total FROM
26
32
 
27
33
  (SELECT * from `sales` where deal_date between '2021-03-28' and '2021-03-29' and payment not in (9)) AS sub
28
34
 
29
35
  GROUP BY payment;
30
36
 
37
+ ```
38
+
39
+
40
+
31
41
 
32
42
 
33
43
  〇Laravelのクエリビルダで作成したクエリ
34
44
 
45
+ ```Laravel
46
+
35
- public static function getTotal()
47
+ public static function getTotal()
36
48
 
37
49
  {
38
50
 
@@ -58,11 +70,21 @@
58
70
 
59
71
 
60
72
 
73
+ ```
74
+
75
+
76
+
61
77
  〇Laravelのエラー
78
+
79
+ ```LaravelException
62
80
 
63
81
  Illuminate\Database\QueryException
64
82
 
65
83
  SQLSTATE[HY000]: General error: 2031 (SQL: SELECT payment, count(payment) AS num, sum(price) AS total from (select * from `sales` where `deal_date` between ? and ? and `payment` not in (?)) AS sub group by `payment`)
84
+
85
+ ```
86
+
87
+
66
88
 
67
89
 
68
90