このクエリを回避するのに問題があり、誰かが助けてくれるかどうか疑問に思っています:
modx_site_tmplvar_contentvalues からすべての tvv.value[s] を選択しようとしています。tvv.tmplvarid = 1 および tvv.tmplvarid の tvv.value = 3 は、今日以降の日付です。
基本的に、公開され、「24」の親を持つ各 modx_site_content.id には、modx_site_tmplvar_contentvalues テーブルに少なくとも 2 つのエントリが含まれます。 3' 日付スタンプになります。
modx_site_tmplvar_contentvalues テーブルからすべての値を選択する必要があります。ここで、tmplvarid は「1」です [コンマ区切りのリスト]。ここで、「3」に等しい 2 番目のエントリ tmplvarid は、今日以降の日付であり、modx_site_content 条件が公開されています = ' 1' および親 = '24'
これが私のクエリです[うまくいきません]
SELECT sc.id, sc.pagetitle, tvv.value, tvv.tmplvarid, tvv.id
FROM modx_site_content sc
left join modx_site_tmplvar_contentvalues tvv on tvv.contentid = sc.id
where published = '1'
and parent = '24'
and (tvv.tmplvarid = '3' or tvv.tmplvarid = '1')
and tvv.value >= curdate()
group by sc.id
order by sc.id
何か助けはありますか?