I'm more familiar with Microsoft flavors of SQL so I'm having some trouble with this.
Maybe some folks here can help.. I'm trying to query a few identical-structure tables.. so I'm tossing in some server side programming to generate it fast.. but I'll just give you guys the output and its giving me an error
Attempted Method 1:
Attempted Method 2: I spent more time on this one as I thought it was more likely to work than #1, because I've never tried a select query without a from clause in the master query.
In both examples, pdb.manufacturers (alias: hm) is a table in a seperate datasource. Each table is in its own datasource with an identical setup of other tables. I'm supposed to pull all of this information together and I'm missing it somewhere.
ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
Maybe some folks here can help.. I'm trying to query a few identical-structure tables.. so I'm tossing in some server side programming to generate it fast.. but I'll just give you guys the output and its giving me an error
Attempted Method 1:
Code:
select
(select count(*) as p1_count from d1.Products as P, pdb.Manufacturers as HM where P.ManufacturerID = HM.AutoID) as p1,
(select count(*) as p2_count from d2.Products as P, pdb.Manufacturers as HM where P.ManufacturerID = HM.AutoID) as p2,
(select count(*) as p3_count from d3.Products as P, pdb.Manufacturers as HM where P.ManufacturerID = HM.AutoID) as p3
Attempted Method 2: I spent more time on this one as I thought it was more likely to work than #1, because I've never tried a select query without a from clause in the master query.
Code:
select * from
(select count(*) as p1_count from d1.Products as P, pdb.Manufacturers as HM
where P.ManufacturerID = HM.AutoID) as p1_products,
(select count(*) as p2_count from d2.Products as P, pdb.Manufacturers as HM
where P.ManufacturerID = HM.AutoID) as p2_products,
(select count(*) as p3_count from d3.Products as P, pdb.Manufacturers as HM
where P.ManufacturerID = HM.AutoID) as p3_products
In both examples, pdb.manufacturers (alias: hm) is a table in a seperate datasource. Each table is in its own datasource with an identical setup of other tables. I'm supposed to pull all of this information together and I'm missing it somewhere.
ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.