Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6321643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:11:14+00:00 2026-05-24T16:11:14+00:00

i want to create a table with product list with its each product, its

  • 0

i want to create a table with product list with its each product, its price list, but the problem is that i cant join two queries, because i want one output to be inserted in another output, but it is impossible to achieve just putting them in this way, i know that i have to join 2 sql queries in order to make them work properly, plus for each product have 4 prices, anyway, to make it more clear i made a screenshot the way i want it to see: http://s44.radikal.ru/i106/1108/57/33380d0557f4.jpg and here is the queries:

Product query:

<cfquery name="get_products" datasource="#dsn3#">   SELECT DISTINCT P.*,PS.MONEY,PS.PRICE   FROM PRODUCT P,PRICE_STANDART PS    WHERE       P.IS_SALES=1        AND P.IS_PURCHASE=1         AND P.IS_INTERNET=1         AND P.PRODUCT_ID=PS.PRODUCT_ID      AND PS.PURCHASESALES=1      AND PS.PRICESTANDART_STATUS=1       <cfif len(trim(attributes.product_cat)) and len(attributes.product_code)>           AND P.PRODUCT_CODE LIKE '#attributes.product_code#%'        </cfif>         <cfif isdefined('attributes.product_id') and len(attributes.product_id)>            AND P.PRODUCT_ID=#attributes.product_id#        </cfif>     ORDER BY PS.PRICE DESC </cfquery>

Price query:

<cfquery name="get_prices" datasource="#dsn3#">
        SELECT PRICE, PRODUCT_ID FROM PRICE WHERE PRODUCT_ID = #PRODUCT_ID#
    </cfquery>

and the table:

<table cellpadding="3" cellspacing="1" class="color-border" width="100%">
    <tr class="color-header">
        <td width="30" class="header_bold">No</td>
        <td><b>Ürün</b></td>
        <td class="header_bold" width="80">Liste fiyatı</td>
        <td class="header_bold" width="80">Bayı 1</td>
        <td class="header_bold" width="80">Bayı 2</td>
        <td class="header_bold" width="80">Bayı 3</td>
        <td class="header_bold" width="80">Bayı 4</td>
        <td class="header_bold" width="25">Para</td>
    </tr>
    <cfoutput query="get_products" startrow="#attributes.startrow#" maxrows="#attributes.maxrows#">
        <tr height="20" onMouseOver="this.className='color-light';" onMouseOut="this.className='color-row';" class="color-row">
            <td>#currentrow#</td>
            <td>#product_name#</td>
            <td>#tlformat(price,2)#</td>
            <td>#tlformat((price*0.5),2)#</td> <!---this is fixed price! --->
            <td>#tlformat((price*0.49),2)#</td> <!---this is fixed price! --->
            <td>#tlformat((price*0.475),2)#</td> <!---this is fixed price! --->
            <td>#tlformat((price*0.45),2)#</td> <!---this is fixed price! --->
            <td align="center">#MONEY#</td>
        </tr>
    </cfoutput>
</table>

the explanation “this is fixed price!” means i inserted them and counted it by my own, but it should be changed from the prices list i want to integrate, but i can’t…
thank you all for the help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T16:11:15+00:00Added an answer on May 24, 2026 at 4:11 pm

    You really should do a join on the queries:

    <cfquery name="get_products" datasource="#dsn3#">   
    SELECT DISTINCT P.*,PS.MONEY,PS.PRICE   
    FROM PRODUCT P
    JOIN PRICE_STANDART PS ON P.PRODUCT_ID = PS.PRODUCT_ID
    JOIN PRICE PR ON P.PRODUCT_ID = PR.PRODUCT_ID  
    WHERE       
    P.IS_SALES=1        
    AND P.IS_PURCHASE=1         
    AND P.IS_INTERNET=1               
    AND PS.PURCHASESALES=1      
    AND PS.PRICESTANDART_STATUS=1       
    <cfif len(trim(attributes.product_cat)) and len(attributes.product_code)>           
      AND P.PRODUCT_CODE LIKE '#attributes.product_code#%'        
    </cfif>         
    <cfif isdefined('attributes.product_id') and len(attributes.product_id)>            
       AND P.PRODUCT_ID=#attributes.product_id#        
    </cfif>     
    ORDER BY PS.PRICE DESC 
    </cfquery>
    

    If the PRICE table returns more than one price for each product, you could then use the GROUP attribute of . For more info on that, take a look here: http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7ff6.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a table structure with checkbox for each row and each
I want to create some table through PHP but it fails everytime, but the
I want to echo the contents of a table (a product list) yet still
I want to create a rake task to fill the details of product but
i want to create a table : products which looks like (these are columns
I want to create a table with horizontal columns. How I make position() values
I want to create a table of friends with personal information and log on
I want to create a table like myTable = { [0] = { [a]
I want to create a table in MS SQL Server 2005 to record details
I want to create this table in Oracle. This is only the table SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.