开发者

How to execute two quires in 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开发者_StackOverflow社区 quires in JDBC


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:

SELECT emp.name,
       emp.salary,
       COUNT(*) OVER () AS total_count
FROM   employees emp;


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜