'。 #x27;
请我需要帮助修复上面的错误_在标题_中的第一个选择中出现在此查询之后,欢迎所有建议,因此非常感谢。
public ArrayList<HashMap<String, String>> getAll_Datas() {
ArrayList<HashMap<String, String>> arrayListAllData = new
ArrayList<HashMap<String, String>>();
SQLiteDatabase database = this.getWritableDatabase();
Cursor cursor = database.rawQuery
(
" SELECT lespontes.idPontes ,\n" +
" lespontes.Cage as Cage,\n" +
" lespontes.Couvés,\n" +
" dbfécondation.Fécondés " + "FROM " +
(
" SELECT idPontes FROM lespontes"+
" UNION "
+ " SELECT idPontes FROM dbfécondation" ) +
" LEFT OUTER JOIN"
+ " lespontes USING (idPontes)"+
" LEFT OUTER JOIN "
+ " dbfécondation USING (idPontes)"+
" Order By " + " lespontes.Cage " + " ASC ",null);
if (cursor.moveToFirst()) {
do {
HashMap<String, String> hashMapData= new HashMap<String,
String>();
hashMapData.put("idPontes", cursor.getString(0));
hashMapData.put("Cage",cursor.getString(1));
hashMapData.put("Couvés",cursor.getString(2));
hashMapData.put("Fécondés", cursor.getString(3));
arrayListAllData.add(hashMapData);
} while (cursor.moveToNext());
}
return arrayListAllData;
}
Please I need help fixing the error above _ in the title _ appeared in the first SELECT after FROM of this query, all suggestions are welcome so thank you very much.
public ArrayList<HashMap<String, String>> getAll_Datas() {
ArrayList<HashMap<String, String>> arrayListAllData = new
ArrayList<HashMap<String, String>>();
SQLiteDatabase database = this.getWritableDatabase();
Cursor cursor = database.rawQuery
(
" SELECT lespontes.idPontes ,\n" +
" lespontes.Cage as Cage,\n" +
" lespontes.Couvés,\n" +
" dbfécondation.Fécondés " + "FROM " +
(
" SELECT idPontes FROM lespontes"+
" UNION "
+ " SELECT idPontes FROM dbfécondation" ) +
" LEFT OUTER JOIN"
+ " lespontes USING (idPontes)"+
" LEFT OUTER JOIN "
+ " dbfécondation USING (idPontes)"+
" Order By " + " lespontes.Cage " + " ASC ",null);
if (cursor.moveToFirst()) {
do {
HashMap<String, String> hashMapData= new HashMap<String,
String>();
hashMapData.put("idPontes", cursor.getString(0));
hashMapData.put("Cage",cursor.getString(1));
hashMapData.put("Couvés",cursor.getString(2));
hashMapData.put("Fécondés", cursor.getString(3));
arrayListAllData.add(hashMapData);
} while (cursor.moveToNext());
}
return arrayListAllData;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用: -
IE选择围绕的括号已嵌入SQL中。此外,也已删除了无用的线馈电(
\ n
)。Try using :-
i.e. the parenthesises surrounding the SELECT have been embedded within the SQL. Also the useless line feeds (
\n
's) have also been removed.