我想在sqlite中写这个查询所以请帮助我.....感谢所有
SELECT d.name_ar, d.name_en,d._id
FROM drug_term dt
INNER JOIN generic_drug d ON d._id = dt.drug_id
WHERE dt.term_id = 1047
AND d.type =1
GROUP BY d._id
答案 0 :(得分:1)
您必须在GROUP BY中提供所有这些字段“d.name_ar,d.name_en,d._id”
SELECT d.name_ar, d.name_en,d._id
FROM drug_term dt
INNER JOIN generic_drug d ON d._id = dt.drug_id
WHERE dt.term_id = 1047
AND d.type =1
GROUP BY d.name_ar, d.name_en,d._id