Fintech -Betriebssystem -Abfrage Nutzlast
Posted: 04 Mar 2025, 09:50
Eine Nutzlast für diese < /p>
versichern
Die Beziehungen sind korrekt. Das Problem besteht darin, dass die innere Beziehung wie pol, die sich auf MXP anschließt>
versichern
Code: Select all
SELECT acc.id, pol.id, add.id, fp.no
FROM account acc
LEFT JOIN address add ON acc.ad_id = add.ad_id
LEFT JOIN mpol pol ON pol.ac_id = acc.id
LEFT JOIN mxpol ON pol.mid = mxp.mxid
LEFT JOIN polF fp ON fp.fpid = mxp.fid
WHERE
(
(acc.sdate >= '2025-01-01' AND acc.sdate < '2025-02-01')
OR (acc.mdate >= '2025-01-01' AND acc.mdate < '2025-02-01')
)
AND fp.vuln = TRUE;
< /code>
Hier ist die Abfrage, die ich versuche, < /p>
Das habe ich baut < /p>
{
"entity": {
"alias": "acc",
"name": "account",
"attributeList": [
{ "name": "id", "alias": "acc_id" }
],
"join": [
{
"entity": {
"alias": "add",
"name": "address",
"attributeList": [
{ "name": "id", "alias": "add_id" }
]
},
"fromTo": [
{ "from": "ad_id", "to": "ad_id" }
],
"type": "left"
},
{
"entity": {
"alias": "pol",
"name": "mpol ",
"attributeList": [
{ "name": "id", "alias": "pol_id" }
]
},
"fromTo": [
{ "from": "id", "to": "ac_id" }
],
"type": "left"
},
{
"entity": {
"alias": "mxp",
"name": "mxpol ",
"attributeList": []
},
"fromTo": [
{ "from": "mid", "to": "mxid" }
],
"type": "left"
},
{
"entity": {
"alias": "fp",
"name": "polF ",
"attributeList": [
{ "name": "no", "alias": "fp_no" }
]
},
"fromTo": [
{ "from": "fpid", "to": "fid" }
],
"type": "left"
}
]
},
"where": {
"type": "and",
"expressionList": [
{
"type": "or",
"expressionList": [
{
"type": "and",
"conditionList": [
{ "type": "gte", "first": "acc.sdate", "second": "2025-01-01" },
{ "type": "lt", "first": "acc.sdate", "second": "2025-02-01" }
]
},
{
"type": "and",
"conditionList": [
{ "type": "gte", "first": "acc.mdate", "second": "2025-01-01" },
{ "type": "lt", "first": "acc.mdate", "second": "2025-02-01" }
]
}
]
},
{
"type": "equals",
"first": "fp.vuln",
"second": "true"
}
]
}
}