0
私はこれに新しいので、説明と私と一緒に裸をしてください。異なるテーブルを連結しますか?
2つの異なるテーブルから連結する必要があります。
s.panelid
(結果は "AA"と同じ)をb.modulecodes
と返し、number_of_stringsを返します。 s.panelid
(結果は「AA」など)とnumber_of_string
を入れてください。
select concat(Mid(s.panelid, 5, 2), ' - ' , '??') as `Module Type-Strings`
from r2rtool.stringtopanel s, be.modulecodes b
where s.insertts > '2011-07-15' and s.insertts < '2011-07-26' and Mid(s.panelid, 5, 2) != 99
group by date(insertts), `Module Type-Strings`
order by `Module Type-Strings`;
Be
(表):modulecodes、number_of_strings
- AA - 12
- AB - 4
- AD - 3
- AE - 12
I上記のクエリを実行すると、次のような結果が返されます。Module Type-Strings
= 'AA- ??' 「AB- ??」もちろん。
:Module Type-Strings
= 'AA-12'
s.panelid - > b.modulecodesに基づいてb.number_of_stringsを取得する必要があります。 – TheRealDK