I have this 2 queries (first block of code):
<cfquery name="qGetCategorias" datasource="DSN">
SELECT *
FROM Categorias
ORDER BY CatNome ASC
</cfquery>
<cfquery name="qListProd" datasource="DSN">
SELECT ProID, Fabricante, ProNome, ProDesc, ProValor, CatID
FROM Produtos
WHERE ProID = #URL.ProID#
ORDER BY ProID ASC
</cfquery>
And I would like to create another 2 queries but with a "querying a query" solution.
Knowing this, I try this code but I have not the same result as I do with the first block of queries above..
Look my tentative:
Second block of code:
<cfquery name="qGetCatAndProd" datasource="DSN">
SELECT Categorias.CatID, Categorias.CatNome, Produtos.ProID,
Produtos.Fabricante, Produtos.ProNome, Produtos.ProDesc,
Produtos.ProValor, Produtos.CatID
FROM Categorias, Produtos
ORDER BY Categorias.CatNome ASC
</cfquery>
<cfquery name="qToUseInSelect" dbtype="query">
SELECT *
FROM qGetCatAndProd
WHERE ProID = #URL.ProID#
ORDER BY ProID ASC
</cfquery>
So, What I have to do in the SECOND BLOCK of code to have the same results as I have with the FIRST BLOCK OF QUERIES??