我是 QueryBuilder 的新手,我正在尝试执行 POST 请求(使用 JSON)来检索数据库中的一些信息。
我使用数组是因为每个属性可以有多个值。这是我当前发送的 JSON:
{
"name":["Martin"],
"state":["Ohio", "Texas"],
"job":["Photographer", "Reporter"]
}
这是我的数据库:
ID | NAME | FIRST_NAME | STATE | JOB | SPEAK_FRENCH
1 | Martin | John | Ohio | Photographer | 1
2 | Martin | Max | Ohio | Reporter | 1
3 | Martin | Sophie | Texas | Model | 1
4 | Alexander | David | Kansas | Author | 0
5 | Archie | Kira | Maine | Photographer | 1
6 | Lushen | Albert | Nevada | Pilot, Model | 1
7 | Wilkins | Minnie | Utah | Tailor | 0
8 | Martin | Thomas | Texas | Reporter | 1
9 | Patino | Stephen | Virginia | Pilot, Reporter | 1
10 | Ting | Maria | Nevada | Dentist | 0
11 | Brown | Barbara | Virginia | Reporter | 1
12 | Martin | William | Texas | Photographer | 1
13 | Zachary | Thomas | Virginia | Telephonist | 1
我想要的请求:
SELECT * FROM 'application'
WHERE SPEAK_FRENCH = 1
AND NAME = "Martin"
AND STATE = "Ohio"
AND JOB LIKE "%Photographer%"
OR SPEAK_FRENCH = 1
AND NAME = "Martin"
AND STATE = "Ohio"
AND JOB LIKE "%Reporter%"
OR SPEAK_FRENCH = 1
AND NAME = "Martin"
AND STATE = "Texas"
AND JOB LIKE "%Photographer%"
OR SPEAK_FRENCH = 1
AND NAME = "Martin"
AND STATE = "Texas"
AND JOB LIKE "%Reporter%"
浮云间
婷婷同学_