Results 1 to 2 of 2

Thread: Problem in joining three tables

  1. #1
    Join Date
    Sep 2010
    Posts
    188

    Problem in joining three tables

    Hi..

    I encountered problem in my query to display data.
    here is my separate query then i mix up:

    Code:
    SELECT kc.PCODE, kc.count_wip_chemical_weighing, kc.count_wip_compounding, kc.count_wip_extrusion, kc.count_wip_forming, kc.count_wip_deflashing, kc.kanban, kc.virtual, p.max_lot, p.min_lot FROM kanban_checker kc JOIN plan p ON kc.PCODE = p.PCODE  ORDER BY p.PCODE;
    Code:
    SELECT  kd.LOT_CODE, kd.wip_chemicalweighing, kd.wip_compounding, kd.wip_extrusion, kd.wip_forming, kd.wip_deflashing 
    FROM kanban_data kd JOIN plan p ON kd.PCODE = p.PCODE  ORDER BY p.PCODE;
    mix query
    Code:
    SELECT p.PCODE, kd.LOT_CODE, kd.wip_chemicalweighing, kd.wip_compounding, kd.wip_extrusion, kd.wip_forming, kd.wip_deflashing, kc.count_wip_chemical_weighing, kc.count_wip_compounding, kc.count_wip_extrusion, kc.count_wip_forming, kc.count_wip_deflashing, kc.kanban, kc.virtual, p.max_lot, p.min_lot FROM kanban_data kd JOIN kanban_checker kc ON kd.PCODE = kc.PCODE JOIN plan p ON kc.PCODE = p.PCODE  ORDER BY p.PCODE;
    I want to display PCODE once. like one P35, one P35M .I want it to display with the kc.count_wip_chemical_weighing, kc.count_wip_compounding, kc.count_wip_extrusion, kc.count_wip_forming, kc.count_wip_deflashing, kc.kanban, kc.virtual, p.max_lot, p.min_lot,...No PCODE and max_lot, virtual, min_lot, kanban in this fields:
    kd.LOT_CODE, kd.wip_chemicalweighing, kd.wip_compounding, kd.wip_extrusion, kd.wip_forming, kd.wip_deflashing

    I attach the sample format I need to display which is the excel type and the html type the result from query.

    Thank you
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2012
    Posts
    93

    Problem in joining three tables

    you are not used the write syntax in join in mysql.. and when you are using the join then relation in table is very important. join in mysql has four types: -
    1.inner join
    2.left join
    3.right join
    4.outer join

Similar Threads

  1. Problem in tables with collapseable panels...
    By RyanMc in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 05 Jun 2008, 01:43 AM
  2. Help with tables
    By bmcc81 in forum General Questions
    Replies: 1
    Last Post: 29 Feb 2008, 01:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •