Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 97645

Can you combine multiple queries into one?

$
0
0

I have a database table of options for additions to homes. I have another table for categories for these options. Right now I'm making a lot of queries to get each individual category of options. It looks something like this:

 

</cfquery>

<cfquery datasource="applewood" username="username" password="password" name="getCategory2" >

     SELECT *

     FROM op_categories WHERE idOpCategories = 3

 

</cfquery>

<cfquery datasource="applewood" username="username" password="password" name="getCategory3" >

     SELECT *

     FROM op_categories WHERE idOpCategories = 4

 

</cfquery>

...and so on. Is there a way to make 1 query that will find each WHERE clause? I want it to look like this on one page:

 

Category 1          Category 2          Category 3

---------------         -----------------          ----------------

Option 1             Option 1               Option 1

Option 2             Option 2               Option 2

Option 3             Option 3               Option 3

 

 

Any help would be appreciated.


Viewing all articles
Browse latest Browse all 97645

Trending Articles