Best approach to join multiple statistics tables into one

I have read different approaches to join multiple statistics tables into one, they all have a column "productobjectid".
I want to get all data for each product and put it to excel and output a jpg statistic with cfchart.
How would you do this, the sql part?
Thanks.

A couple suggestions:
1) when joining tables, its best to list both table/fields that you are joining in the FROM clause:
FROM shopproductbehaviour_views INNER JOIN shopproductbehaviour_sails ON shopproductbehaviour_views.productobjectid = shopproductbehaviour_sails.productobjectid
2) You add tables to a SQL join by placing another join statement after the SQL above:
SELECT *
FROM TableA INNER JOIN TableB on TableA.myField = TableB.myField
INNER JOIN TableC on TableA.anotherField = TableC.anotherField
3) If you have columns in the tables that are named the same, you can use column aliases to change the way they appear in your record set:
SELECT TableA.datetimecreated 'tablea_create_date', TableB.datetimecreated 'tableb_create_date'
4) Certainly not a requirement, but you might want to look into using <cfqueryparam> in your where clause:
WHERE shopproductbehaviour_sails.productobjectid = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#all.productobjectid#">
 You might want to consider checking out one of the many tutorials on SQL available online.  Many of the questions you posed in your post are covered in pretty much every basic SQL tutorial.  Alternately, a good SQL book is worth its weight in gold for a beginning web applications developer.

Similar Messages

  • Best approach to get the source tables into Target

    Hi
    I am new to Goldengate and I would like to know what is the best approach to get the Source tables to be replicated into the target (oracle to oracle) before performing the initial load without using exp/expdp . Is there any native Goldengate utility which i can use during the initial load or before that will create the tables on the target before loading the data ?
    Thanks

    i dont think so, for the initial load replication your struncture should be available at target machine. once your machines are in sync then you can use goldengate ddl setup for automatically replicate the table with data. 
    Batter approach for you to create a structure on target machine using export improt.  In export use conect=metadata_only for copy the structure only.....
    like
    EXPDP <<user>>/<<password>>@connection_string schemas=abc directory=TEST_DIR dumpfile= gg.dmp Content = metadata_only logfile= gg.log

  • Joining multiple mp3 files into one

    Hi all,
    I am very puzzled as to how to merge multiple mp3 files into one, to upload to Mixcloud. Now, I do have the "Join Together" script and it worked like a charm a few times but now it just freezes and there's nothing I can do.
    Any ideas? Is there any DJ software, other than Nicecast, that could merge the files?
    Any help will be much appreciated.
    Thanks!

    Fronzenfields,
    A lot of folks preparing mixes for Mixcloud use Audacity.  It is a free audio editor, and has both Mac and Windows versions. 
    Besides joining tracks, it will also let you do crossfades, volume adjustments and other typical audo editing functions necesary to create a good quality mix.
    Editing in Audacity does not modify the original tracks.  You import the tracks into Audacity, do the edits, and  then export a single MP3.

  • Best approach to append multiple Access tables together using java?

    Hello,
    I've been given the task of retrieving data from a collection of Access files and storing them in a MySQL database. The program I wrote works fine, but the problem is that the data is broken up by months and not years. I need access to a years worth of data for my calculations to be accurate.
    Therefore, I need to merge all the tables from different databases(files) for one year(12 tables).
    All the tables are identical, just different values for different days.
    I know how to manually append one table to another in MS Access, but that is too time consuming.
    I was thinking of querying all the data of each month and merging all the result sets into one collection to be later inserted into a new MySQL table.
    Any insight of how to do this efficiently would be greatly appreciated.

    maccartee wrote:
    I wrote a java class that will cycle through each Access file, executing a query to select all the rows in the table I need and insert them into a text file. The problem is that the sql query I use works in mysql but not access:
    SELECT * into OUTFILE 'C:\\TableDump.txt' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n' FROM 8227;
    You can't write such a thing in Access.
    I get the following when I run it:
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Query input must contain at least one table or query.
    I think Access is telling you the right answer: it won't accept that statement.
    8227 is the name of table I want.You named your table '8227'? Oh, my.
    I'm not too familiar with Access, but I thought I could run valid SQL queries?You're not too familiar with SQL. This is only valid in MySQL.
    Why insist on doing this in Java? There's a better way to do this. Save all the Access files as .csv output and import those into MySQL. Java's not the way to go here.
    %

  • How do I join multiple mp3 files into one mp3 file?

    Hello,
    I have multiple mp3 files that I would like to join into one mp3 file and to use it as an audio book. This explains how to do it, but in iTunes 12, I do not see an option called "Part of a Compilation" option.
    Is there a way to do it in iTunes without installing a new app?
    Thank you.

    Eugene,
    Those instructions, if I read them correctly, are about how to collect several MP3s into a single audiobook.  They will not create a single continuous MP3.
    iTunes does not have the ability to combine multiple MP3s into a single MP3.  The best it can do is if you burn them to audio CD and then rip back with "Join Tracks" enabled.  The better way is to use an audio editor such as Audacity, or a special purpose combing tool such as MP3 Joiner.

  • Joining multiple inDesign files into one, can you solve this?

    OK so basically I work at a magazine, the creative's all work on separate spreads so all the inDesign files consist of between 1 and 10 pages then usually they are all spat out in there sets of PDF's and sent to the printers.
    Now I want to do an online addition of the magazine with the new SWF export feature in inDesign CS4 but I'm wondering how can you easily compile all of the separate inDesign files into one so that it can spit out one single swf with all 200 pages with the page peel effect?
    Is there even a way without a mass of work of manually adding all the pages into one file, that would be absolutely humongous? Anyone with any suggestions how to make this process the simplist and with the least amount of labout would be an absoulute legend, I have little time to spend on this which sucks so looking for the best and fastest possible way that we could do it each month.
    Cheers
    J

    I migth have a kind of solution for you. I have made a solution named eDocBrowser. (I called it Magazine Browser in earlier threads here and couple of other forums). It´s a collection of files that you publish with you SWF-files you have exported from InDesign. With eDocBrowser, you can put several SWF-files together and end-user can use them almost as one single SWF. Heres little demo I made just few minutes ago.
    http://www.prepress.fi/eDocBrowser/
    There are 3 SWF-files, all of them exported from InDesign. They are originally separate indd-files. When you reach last page of Document1, small arrow appears, and text "Jump to next file" and name of the next file too. You can go there also by using next-button at the bottom right corner, one that you use normaly to go next page. Same kind of arrow appears also when you are in first page of document 2 or 3 etc... with it you can go back to earlier documents last page etc... All the documents can be seen also in a drop-down menu at top of the screen. Labels of that menu are customizable.
    Theres also a zoom. When you clic zoom+ button, your cursor changes to magnifying glass. With zoom- you can go back to normal view.
    Additional features are FullScreen-view, Printing current spread and customizing user interface, buttons and logo at the top-left corner. Text search is very exprerimental and requires indd-file indexing with script we have made too. It indexes every single word in indd-document to XML-file and put pagenumbers there too. eDocBrowser searches that XML-file and gives all the hits to small result window. Hits are also links to page where they point...Search is not in use with this demo..
    There is a small help-section in top-right corner...
    We also have a script called eDocMaker. It does everything for you. You just have to have indd-files in one folder. Script asks location of that folder when you run it. It also askes you which resolution you want to use with images, anything goes between 72-2400 (72ppi is indesign´s default resolution for SWF-export, using bigger resolution might cause bigger SWF-files, but images look better when zoomed)
    Price of the single licence of eDocBrowser will be 80euros (aprx. 100dollars). With it you may install one copy of eDocBrowser into your server and use as many SWF-files there as you want. There is no search feature in single version.
    Price of unlimited licence is 300euros (aprx.400dollars) With it you may install as many copies of eDocBrowser as you like. With it you also get all the indesign scripts including eDocMaker with resolution booster, search indexer etc. + goodies like user interface and button templates, indesign effect (3D spine graphic etc)....
    Product is about ready, we are just setting up a place to sell it. Now it seems that we are going to use a service called payloadz.com....
    Additional info: petteri.paananen[at]NOSPAMprepress.fi (replace [at] with @ and remove NOSPAM)

  • Join multiple output tables of BAPI into new table

    Hi,
    In my model (VC 7.0), I have a BAPI which outputs two different tables. Tables have many multiple records. Each table has several fields and a common field also. I want to combine these tables into one table form. I used the following methods and result are :
    1. I tried to connect output tables to one table form but no success. Because table form allows only one table input.
    2. I put a combine operator for output tables. No success. Although they're common field and multiple records but table form shows only one record? Where are the other record ?
    3. I put a union operator  for output tables. No success. Because union operator output only the common field. But I need the other fields from output tables in my table form.
    Will you please suggest what are the options available with me for joing output of both tables. I think combine operator should solve.
    Regards,
    Yi&#287;it

    Hi,
    use this link to get your answer:
    Join two Table output to new table
    Otherwise you can try with this:
    1. Drag signal out from the first table. Select all the fields which you want to be pass in the final table.Make the first table as multiple selection one.
    2. Create one button in toolbar for the first table and give some proper name in action property.
    3. mentioned the same action name in the link between the signal out and the first table.
    4. follow the same steps for the second table also.
    5. then from compose choose two signal ins and drag them on the story board. Then give the same name as you have given the signal outs name.
    6. Mention all the fields as you have mentioned in the siganl outs.
    7. Add a combine operator with both the signal ins and combine a table with the outport of the combine operator.
    Save and deploy. I hope it will help you.
    Here, you have to select the rows which you want to visualize in the final output table.
    Regards,
    Nutan
    regards,
    Nutan

  • How to join multiple source tables and do lookup?

    I have a requirement to load a target table by joining 4 source tables. Also I have to do a lookup on a domain table to transform codes and check for nulls. What will be the best approach to load the target table?
    Is it possible to do it in one interface or do I need to build multiple interfaces to achive this?
    My source and target database both are oracle and I am planing to use Oracle Incremental Update Merge.
    Thank you

    You are in the right direction by creating one interface for this transformation.
    You will need to drag drop 4 source tables + the lookup table on the Sources window of Interface and then make appropriate joins.
    Also, check for NULLS in the transformation. Depends what you want to do with the NULLS. If you want to ignore them, use a filter.
    If you want them to error out, use a constraint.
    If you want to convert them, use NVL
    Start with Oracle Incremental Update and once successful, use Oracle Incremental Update MERGE.

  • Can we join Multiple Databases tables in PRD File ?

    Hi ,
    I am working on POC project and trying to Join Multiple Databases to create one rpd file . Lets say I have complete SH schema from Oracle and I want couple of tables (Time and Products) tables from Sybase .
    I want bring sybase TIME and Product tables into Oracle SH Schema and create joins in physical layer. When I try to do it, it is throughing an error .. Am I missing some thing here ?
    Is it possible?
    Thanks
    Shivaji

    You have not mentioned what is the error!!!
    we can create join b/w the tables of different databases
    You need to select the table from one database and aswell as other table in other database and
    right click > physical join > selected tables only...
    This is the way of creating physical joins... or else you select both the databases and select physical joins...
    It's better that you mention what is the error you are getting..??
    Thanks & Regards
    Kishore Guggilla

  • Reg: how to join more than one cluster table into one

    Hi gurus
    How to join more than one cluster table into one
    amk

    Hi,
    You cannot join cluster tables
    Best way is to select from the header table and then select from the item table table using for all entries of header table.
    regards,
    Advait

  • Moving the data from multiple internal tables into a single one

    Hello everyone,
    I am creating a classical report which uses the following tables.
    tables : ekko, ekpo, mara, makt,lfa1.
    my input parameter is 
    Select-options Purchase Order number
    Following fields are getting used.
    Doc no                  EKKO-EBELN
    Material              EKPO-MATNR
    Item number          EKPO-EBELP
    Quantity             EKPO-MENGE
    Material Group          MARA-MATKL
    Vendor                  EKKO-LIFNR
    Old Material code   MARA-BISMT
    Material Desc.           MAKT-MAKTX
    Vendor name         LFA1-NAME1
    Now i need to do the following task.
    1 Select record from EKKO Using document number.
    2 Select record from EKPO using EKKO record using Document no as key.
    3 Find out Old Material code of each and every material from Material master.
    4 Find out Material description for each and every material from MAKT.
    5 Sort record on Vendor, Purchase Order number and Material.
    I have defined seperate internal tables for these operation.
    Once i have fetched records into these individual internal tables  from the corresponding DB tables i need to move these values into a new internal tables which has all the above fields mentioned
    I need to move these values into a new internal table because to display the values on the report.
    Any idea for the above ? Plz help with a sample example or some relevant.
    Regards,
    Ranjith Nambiar

    Hi
    1 Select record from EKKO Using document number.
    2 Select record from EKPO using EKKO record using Document no as key.
    Use inner join and retrive data into one internal table.for Ex ITAB1
    3 Find out Old Material code of each and every material from Material master.
    Use ITAB1 with for allentries in MARA table to get the onl materil number populate in to one table.
    4 Find out Material description for each and every material from MAKT.
    Get the Material desc with the same manner as above,
    5 Sort record on Vendor, Purchase Order number and Material.
    now sort the ITAB1 as you req.
    now Loop on the ITAB1.
    and read above 2 tables for old matnr and matner deac and append into another table as you want.
    Hope this will help.
    Regards,
    Hiren Patel

  • How to join THREE different tables into internal table using one select statement .

    How to join THREE different tables into internal table using one select statement .
    Hi experts,
    I would like to request your guidance in solving the problem of joining the data from three different database tables into one internal table
    Scenario:
    Database tables:
    SPFLI
    SFLIGHT
    SBOOK.
    Table Fields:
    SPFLI - CARRID CONNID COUNTRYFR CITYFRM COUNTRYTO CITYTO
    SFLIGHT - CARRID CONNID FLDATE SEATSMAX SEATSOCC SEATSMAX_C
    SEATSOCC_C SEATSMAX_F SEATSOCC_F
    SBOOK - CARRID CONNID CLASS
    MY INTERNAL TABLE IS IT_XX.
    Your help much appreciated.
    Thanks in advance.
    Pawan.

    Hi Pawan,
    please check below codes. hope it can help you.
    TYPES: BEGIN OF ty_xx,
            carrid     TYPE spfli-carrid   ,
            connid     TYPE spfli-connid   ,
            countryfr  TYPE spfli-countryfr,
            cityfrom   TYPE spfli-cityfrom  ,
            countryto  TYPE spfli-countryto,
            cityto     TYPE spfli-cityto   ,
            fldate     TYPE sflight-fldate ,
            seatsmax   TYPE sflight-seatsmax ,
            seatsocc   TYPE sflight-seatsocc ,
            seatsmax_b TYPE sflight-seatsmax_b,
            seatsocc_b TYPE sflight-seatsocc_b,
            seatsmax_f TYPE sflight-seatsmax_f,
            seatsocc_f TYPE sflight-seatsocc_f,
            class      TYPE sbook-class,
          END OF ty_xx,
          t_xx TYPE STANDARD TABLE OF ty_xx.
    DATA: it_xx TYPE t_xx.
    SELECT spfli~carrid
           spfli~connid
           spfli~countryfr
           spfli~cityfrom
           spfli~countryto
           spfli~cityto
           sflight~fldate
           sflight~seatsmax
           sflight~seatsocc
           sflight~seatsmax_b
           sflight~seatsocc_b
           sflight~seatsmax_f
           sflight~seatsocc_f
           sbook~class
      INTO TABLE it_xx
      FROM spfli INNER JOIN sflight
      ON spfli~carrid = sflight~carrid
      AND spfli~connid = sflight~connid
      INNER JOIN sbook
      ON spfli~carrid = sbook~carrid
      AND spfli~connid = sbook~connid.
    Thanks,
    Yawa

  • What is the best approach to install BI statistics in SAP BI ?

    Hello All,
    what is the best approach to install BI statistics in SAP BI ?
    by collecting objects in standard BI content- 0TCT*objects or
    by executing some standard tcodes.
    Regards,
    Siva

    the best approach is based on version of your BW system follow up install steps in notes:
    BW 3.x:
    309955 - BW statistics - Questions, answers and errors
    BW 7.x
    934848 - Collective note: (FAQ) BI Administration CockpitBW 7.x
    Cheers,
    m./

  • Export multiple tables into one flat file

    I have data in multiple tables on a processing database that I need to move up to a production database. I want to export the data into a flat file, ftp it to the production server and have another job pick up the file and process it. I am looking for
    design suggestions on how to get multiple tables into one flat file using SSIS?
    Thank You.

    Hey,
    Without a bit more detail, as per Russels response, its difficult to give an exact recommendation.
    Essentially, you would first add a data flow task to your control flow.  Create a source per table, then direct the output of each into an union all task.  The output from the union all task would then be directed to a flat file destination.
    Within the union all task you can map the various input columns into the appropriate outputs.
    If the sources are different, it would probably be easiest to add a derived column task in-between the source and the union all, adding columns as appropriate and setting a default value that can be easily identified later (again depending on your requirements).
    Hope that helps,
    Jamie

  • Merging (Joining) two tables into one

    Is it possible to merge two adjacent tables into one table in Pages? Also, how can you split one table into multiple tables?

    If we use the exact meaning of the words, the response is no and no.
    If we play a bit with the meanings we may do the trick.
    (1) I create a table with 6 columns and 5 rows.
    (2) select cells D1 …F5, copy, paste in the document but out of the table. We get the right half of the table.
    From the tool bar, reduce the number of columns of table 1 fom 6 to 3. Bingo we have the two halves of the original table.
    (3)Select the first half and increase the number of rows from 5 to 10
    (4) copy the entire second half, select cell D1 in the enlarged table, paste.
    Bingo, we have the merged table.
    For sure, a merge and a split tables features would be welcome but as the table tool is the one used in the spreadsheet, I would be surprised if these features where introduced one day.
    _Go to "Provide Pages Feedback" in the "Pages" menu_, describe what you wish.
    Then, cross your fingers, and wait _at least_ for iWork'11
    Yvan KOENIG (VALLAURIS, France) jeudi 22 avril 2010 17:28:48

Maybe you are looking for