如何在 JDBC 中执行两个查询
我对 android 很陌生,我尝试将 JDBC 连接到我的应用程序并且它工作正常。它以列表视图格式显示数据库内容。现在我想显示计数,因为我想同时执行两个查询,是否有可能做到这一点。请让我知道如何在 JDBC 中执行两个查询
I am fresh to android, and i tried to connect JDBC to my application and its working properly. it displays database content in listview format. and now I want to display the number of counts, for that i want to execute two queries at the same time, is there any possibility to do this. please let me know how to execute two quires in JDBC
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
大多数时候,如果您需要数据库中的不止一项内容,您可以将它们组合成一个查询。
例如,如果您想要员工列表以及员工总数,则可以使用如下查询:
Most of the time, if you need more than one thing from the database, you can combine them into one query.
For example, if you want a list of employees, as well as a total count of employees, you could use a query like this:
同时进行两个查询?或者您想使用一个查询的结果作为下一个查询的输入?如果是这种情况,请使用子查询
two queries at the same time? or do you want to use the result of one query as the input for the next one? if thats the case, use subqueries