Hi Michael,

You've got two options that I can think of off the top of my head.

A.  You execute each query separately, then cobble the results
together "manually" in your Java code to build an instance of
"ChannelCount".

B.  You craft a single query, assuming you have a master table for the
channels (called Channels in this example):

SELECT     channel,
                          (SELECT     COUNT(*)
                            FROM          scrimbot_channels sc
                            WHERE      sc.channel = c.channel) AS existingCount,
                          (SELECT     COUNT(*)
                            FROM          scrimbot_pending_channels spc
                            WHERE      sc.channel = c.channel) AS pendingCount
FROM         Channels c

You could use the query above for a queryForList(), or add a suitable
WHERE clause for queryForObject().

If you don't have a "Channels" table, try changing the above query to
hit the "dummy" table, which depends on your particular DBMS.

Ted

Reply via email to