質問編集履歴
2
写真追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -112,6 +112,12 @@
|
|
112
112
|
|
113
113
|
|
114
114
|
|
115
|
+
######サブクエリ実行後のテーブル
|
116
|
+
|
117
|
+
![イメージ説明](3af057b7389a4cca3bff1f3ed235d1a0.png)
|
118
|
+
|
119
|
+
|
120
|
+
|
115
121
|
######エラー
|
116
122
|
|
117
123
|
Error: SQLSTATE[21000]: Cardinality violation: 1241 Operand should contain 1 column(s)
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -43,3 +43,75 @@
|
|
43
43
|
}
|
44
44
|
|
45
45
|
```
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
######発行されているSQL文
|
50
|
+
|
51
|
+
```SQL
|
52
|
+
|
53
|
+
SELECT
|
54
|
+
|
55
|
+
Datacklists.id AS `Datacklists__id`,
|
56
|
+
|
57
|
+
Datacklists.dal01 AS `Datacklists__dal01`,
|
58
|
+
|
59
|
+
group_concat(Daldata15s.name SEPARATOR ";") AS `daldata15s`
|
60
|
+
|
61
|
+
FROM
|
62
|
+
|
63
|
+
datacklists Datacklists
|
64
|
+
|
65
|
+
LEFT JOIN Dallist15s ON Dallist15s.datacklists_id = Datacklists.id
|
66
|
+
|
67
|
+
LEFT JOIN Daldata15s ON Daldata15s.dal15_id = Dallist15s.dal15_id
|
68
|
+
|
69
|
+
WHERE
|
70
|
+
|
71
|
+
(
|
72
|
+
|
73
|
+
status = 1
|
74
|
+
|
75
|
+
AND Dallist15s.datacklists_id IN (
|
76
|
+
|
77
|
+
SELECT
|
78
|
+
|
79
|
+
Dallist15s.datacklists_id AS `Dallist15s__datacklists_id`,
|
80
|
+
|
81
|
+
group_concat(dal15_id SEPARATOR ";") AS `dal15s`
|
82
|
+
|
83
|
+
FROM
|
84
|
+
|
85
|
+
dallist15s Dallist15s
|
86
|
+
|
87
|
+
WHERE
|
88
|
+
|
89
|
+
Dallist15s.dal15_id in (1, 2)
|
90
|
+
|
91
|
+
GROUP BY
|
92
|
+
|
93
|
+
Dallist15s.datacklists_id
|
94
|
+
|
95
|
+
)
|
96
|
+
|
97
|
+
)
|
98
|
+
|
99
|
+
GROUP BY
|
100
|
+
|
101
|
+
Datacklists.id
|
102
|
+
|
103
|
+
ORDER BY
|
104
|
+
|
105
|
+
Datacklists_id DESC
|
106
|
+
|
107
|
+
LIMIT
|
108
|
+
|
109
|
+
50 OFFSET 0
|
110
|
+
|
111
|
+
```
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
######エラー
|
116
|
+
|
117
|
+
Error: SQLSTATE[21000]: Cardinality violation: 1241 Operand should contain 1 column(s)
|