PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
[RESOLVED] how to Query Data from 2 tables and combine the results in one table-VBForums
Results 1 to 5 of 5

Thread: [RESOLVED] how to Query Data from 2 tables and combine the results in one table

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2018
    Posts
    90

    Resolved [RESOLVED] how to Query Data from 2 tables and combine the results in one table

    I want to query data from 1 table and other table then combine the result in one table.

    here is my sql query code select statements.

    Code:
    ----3412 STATION IRC4 
    SELECT LINE_NO,COUNT(MO_SN)AS IRC4_OUTPUT FROM DQC3412 WHERE MO_SN LIKE 'S46M%'AND STATION ='RC4' AND LINE_NO='H5' AND TEST_DTTM BETWEEN TO_DATE('20180530','yyyymmdd') 
    AND TO_DATE('20180530 235959','yyyymmdd hh24miss') 
    GROUP BY LINE_NO,STATION  
    ----3422 STATION RC4 
    SELECT LINE_NO,COUNT(MO_SN)AS RC4_OUTPUT FROM DQC3422 WHERE MO_SN LIKE 'S46M5%'AND DEF_ITEM='OK' AND STATION ='RC4'AND LINE_NO='H5' AND TEST_DTTM BETWEEN TO_DATE('20180530','yyyymmdd') 
    AND TO_DATE('20180530 235959','yyyymmdd hh24miss') 
    GROUP BY LINE_NO 
     
    ----3422 STATION VMI2 
    SELECT LINE_NO,COUNT(MO_SN)AS VMI2_OUTPUT FROM DQC3422 WHERE MO_SN LIKE 'S46M5%' AND DEF_ITEM='OK' AND STATION ='VMI2' AND LINE_NO='H5' AND TEST_DTTM BETWEEN TO_DATE('20180530','yyyymmdd') 
    AND TO_DATE('20180530 235959','yyyymmdd hh24miss') 
    GROUP BY LINE_NO

    below is the output , I want to combine all in 1 table please help me. thanks in advance.
    Name:  eeeeeeeee.jpg
Views: 194
Size:  15.8 KB
    Attached Images Attached Images  

Tags for this Thread

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width