I am new to db2 database and trying to convert a sql statement that works fine on SQL-2000 into db2 database.
Basically What I am trying todo is If I have two tables named table1 and table 2, I want to count the number of rows in these two tables and represent the results as two different coloumns in the result set. The following statement works fine for me in SQL server 2000. Can anyone tell me the equivalent db2 statement
SELECT (SELECT COUNT(*) FROM Table1) AS Count1,
(SELECT COUNT(*) FROM Table2) AS count2
The resultset is a table with two coloumns Count1 and Count2 in it.