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

  • Home
  • SEARCH
  • 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 9106431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:20:23+00:00 2026-06-17T02:20:23+00:00

I’m goin to start use mysql 5.1 community version. First I have… master_product_table ID

  • 0

I’m goin to start use mysql 5.1 community version.

First I have…

master_product_table

ID  Product_Code    Product_Name           Product_Details 
=====================================================================
1   000001         Raw Material 1        000001- Raw Material 1
2   000002         Raw Material 2        000002- Raw Material 2
3   000003         Raw Material 3        000003- Raw Material 3
4   000004         Raw Material 4        000004- Raw Material 4

where ID field is the PK

and master_document

Doc_no   Doc_date   Doc_type     Item_code1    Item_qty1     Item_price1     Item_code2     Item_qty2     Item_price2
=========================================================================================================================
000001   01-01-2013 BC. 2.3          1            200          $ 150             3             500           $800
000002   02-01-2013 BC. 2.7          2           1500          $ 800             4            6000          $2500
000003   03-01-2013 BC. 3.0          3           5000          $1500             1           12000          $8500
000004   04-01-2013 BC. 4.0          4          12000          $5000             2             750          $3000

where Doc_no field is the PK

What I want to get is like this…

Doc_no   Doc_date   Doc_type    Item_details1                Item_qty1    Item_price1       Item_details2                Item_qty2     Item_price2
========================================================================================================================================================
000001   01-01-2013 BC. 2.3    000001- Raw Material 1            200          $ 150       000003- Raw Material 3             500           $800
000002   02-01-2013 BC. 2.7    000002- Raw Material 2           1500          $ 800       000004- Raw Material 4            6000          $2500
000003   03-01-2013 BC. 3.0    000003- Raw Material 3           5000          $1500       000001- Raw Material 1           12000          $8500
000004   04-01-2013 BC. 4.0    000004- Raw Material 4          12000          $5000       000002- Raw Material 2             750          $3000

Any help on how to do this would be helpful thank you.

  • 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-06-17T02:20:24+00:00Added an answer on June 17, 2026 at 2:20 am

    Try this:

    SELECT md.Doc_no, md.Doc_date, md.Doc_type, 
           mp1.Product_Details Item_details1, md.Item_qty1, md.Item_price1, 
           mp2.Product_Details Item_details2, md.Item_qty2, md.Item_price2 
    FROM master_document md 
    INNER JOIN master_product_table mp1 ON md.Item_code1 = mp1.ID 
    INNER JOIN master_product_table mp2 ON md.Item_code2 = mp2.ID ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am confused How to use looping for Json response Array in another Array.
I am trying to understand how to use SyndicationItem to display feed which is
this is what i have right now Drawing an RSS feed into the php,
Specifically, suppose I start with the string string =hello \'i am \' me And
I have a small JavaScript validation script that validates inputs based on Regex. I
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.