gpt4 book ai didi

android如何做一个select和where join语句

转载 作者:行者123 更新时间:2023-11-29 22:28:38 24 4
gpt4 key购买 nike

    SQLiteDatabase db = dbs.getReadableDatabase();
String SQL = "SELECT * FROM one a " +
"join two b on a.oneID = b.twoID " +
"where a.oneId = '"+Id+"' And where " +
"b.column2 = 'Inc'";
Cursor cursor2 = db.rawQuery(SQL, null);
startManagingCursor(cursor2);

如何让这个声明生效?

最佳答案

"SELECT * FROM one a " +
"join two b on a.oneID = b.twoID " +
"where a.oneId = '"+Id+"' And " +
"b.column2 = 'Inc'";

只有在你需要使用“where”的时候

关于android如何做一个select和where join语句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5078108/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com