我有以下查询:
$stmt = $conn->query("SELECT * FROM research as r LEFT JOIN research_participants as rp ON rp.research_no = r.id LEFT JOIN researcher as rc ON rc.id = rp.researcher_id where r.id = $researchid");
这个查询工作得很好,但是,我希望它只选择状态=“完成”的研究,所以我将其更改为以下内容:
$stmt = $conn->query("SELECT * FROM research WHERE status= 'done' as r LEFT JOIN researcher as rp ON r.researcher_id = rp.id");
不幸的是,它不起作用。我还尝试了以下方法:
$stmt = $conn->query("SELECT * FROM research as r LEFT JOIN researcher as rp ON r.researcher_id = rp.id WHERE status= 'done'");
但即使这样也行不通。
研究表如下所示: 在此处输入图像描述
墨色风雨
繁花不似锦