Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
请帮助我在android开发中编写查询
"SELECT * FROM '" + pendingpost_tb + "'" + " where '" + AppUtil.post_type + "'" + "=history " + " order by '" + AppUtil.datetime + "'" + " DESC"
我想要按日期和时间按 desc 顺序排列的 AppUtil.post_type 列表,日期时间我已从数据库中获取。
你的陈述有问题。我认为这是一份工作声明:
"SELECT * FROM " + pendingpost_tb + " where " + AppUtil.post_type + "='history'" + " order by " + AppUtil.datetime + " DESC"
您确定 AppUtil.datetime 是您的列名吗?
此外,最好使用 PreparedStatments。我不确定 PreparedStatement 是否可用于 android,但必须有与之等效的东西。