How to avoid data repetation when using select statements with innerjoin

how to avoid data repetation when using select statements with innerjoin.
thanks in advance,
satheesh

you can use a query like this...
  SELECT DISTINCT
         frg~prc_group1                  "Product Group 1
         frg~prc_group2                  "Product Group 2
         frg~prc_group3                  "Product Group 3
         frg~prc_group4                  "Product Group 4
         frg~prc_group5                  "Product Group 5
         prc~product_id                  "Product ID
         txt~short_text                  "Product Description
UP TO 10 ROWS
INTO TABLE l_i_data
FROM
Joining CRMM_PR_SALESG and
COMM_PR_FRG_ROD
crmm_pr_salesg AS frg
INNER JOIN comm_pr_frg_rod AS prd
ON frgfrg_guid = prdfragment_guid
Joining COMM_PRODUCT and
COMM_PR_FRG_ROD
INNER JOIN comm_product AS prc
ON prdproduct_guid = prcproduct_guid
Joining COMM_PRSHTEXT and
COMM_PR_FRG_ROD
INNER JOIN comm_prshtext AS txt
ON prdproduct_guid = txtproduct_guid
WHERE frg~prc_group1 IN r_zprc_group1
   AND frg~prc_group2 IN r_zprc_group2
   AND frg~prc_group3 IN r_zprc_group3
   AND frg~prc_group4 IN r_zprc_group4
   AND frg~prc_group5 IN r_zprc_group5.
reward it it helps
Edited by: Apan Kumar Motilal on Jun 24, 2008 1:57 PM

Similar Messages

  • Wrong date format when using selection screen query

    Hi all,
    I have a problem in a report when usign the selection screen of the query.
    the system has been upgraded recently from a 3.5 to 7.0. when a query is run in the bex web the user can put in the selection date needer to run the query.
    currently if u select a month using the selection screen next to the input form, the month will show up in the input field
    as 006 09 (006space09) instead of 06.2009 for the selection of june. 
    does anyone know how to fix this? it was working good using the 3.5 version of the bex web.
    Any help apriciated

    Using the list cube transaction and using the selection sceen and selecting the month it does put the right selection in the input field. ive also just tested it using de bx excel plugin and using the selection screen the correct value is set in the input field.  so i think it more of a bex we b problem but i dont know where to start the search for the solution.

  • How to avoid data loss when an action is perfomed ....

    hi,
    I am using a dynamic Tab. Each tab contains a seperate jsp page.( the jsp page is included for the corresponding tab). Each page can contain more than 25 fields. The problem is for example i will select some check box in the first tab and i will go the second tab and i will do some insert operations , when i came back to the first tab , the checkbox which i had selected or the text what i had entered should be there. If it can be solved by using AJAX, pls guide me.
    Tools i am using : jsp, struts.
    Looking forward to hear to solve this problem.

    hi....
    c through that when u eturn to tab.... set the form values to the page
    i mean if u r using a form bean for ur jsp. use name name atrribute of the sturts html tag. and give the form bean name to the name attribute i hope this would solve your problem
    thaks
    with rgards
    shekhar

  • How to give date in where of select statement

    hi
    iam using this stmt   SELECT  AUFNR    WERKS   KDAUF   KDPOS    PLNBEZ    GAMNG
              GMEIN      GSTRP       GLTRP       FROM CAUFV       INTO TABLE TB_CAUFV
              WHERE AUFNR IN S_AUFNR
             AND KDAUF IN S_KDAUF
             AND WERKS IN S_WERKS
              AND GSTRP = V_DATE1.
             AND GLTRP = V_DATE2.
    this is not working.
    v_date1  is of sy-datum.
    plz sol me this
    thanks and reg
    viju

    HI sriram,
    can u check if the date is in the same format in table CAUFV as in sy-datum?
    the date format in sy-datum is stored as yyyymmdd..check if the date for comparison is in the same format..or change
    it to the format..of sy-datum
    reward if useful
    regards,
    sampath
    Edited by: sampath pilla on Jun 13, 2008 3:36 PM

  • Statement closed when using callable statements with oracle xe

    hi all, i've got this problem with oracle express edition 10g. I am using also oc4j v10.1.2.0.2. When working with a normal oracle database it was working fine (i think the code was the same, it's some time since i last tried, but you can see the code is very simple).
    So i just create a callable statement like this:
    CallableStatement cs = con.prepareCall(sentencia.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE, ResultSet.HOLD_CURSORS_OVER_COMMIT);
    and then when trying to access the statement to register an out parameter like this
    cs.registerOutParameter(1, parámetros[0].getTipo());
    it gives this error:
    java.sql.SQLException: Statement was closed
    It's puzzling me because, as i said before, i think the same code was working ok with a normal oracle database.
    Any idea what can it be?
    cheers

    Ah okay, sorry I've re-read your post.
    I believe you need to create a clob object that encapsulates your xml file.
    I've never done this but I would image it involves creating a class that implements the clob interface and passing an instantiation of this class to the callablestatement.
    Let me know how you get on.

  • What is difference when using import statement with static keyword ?

    10. package com.sun.scjp;
    11. public class Geodetics {
    12. public static final double DIAMETER = 12756.32; // kilometers
    13. }
    Which two correctly access the DIAMETER member of the Geodetics class? (Choose two.)
    A. import com.sun.scjp.Geodetics;
    public class TerraCarta {
    public double halfway()
    { return Geodetics.DIAMETER/2.0; }
    B. import static com.sun.scjp.Geodetics;
    public class TerraCarta{
    public double halfway() { return DIAMETER/2.0; } }
    C. import static com.sun.scjp.Geodetics.*;
    public class TerraCarta {
    public double halfway() { return DIAMETER/2.0; } }
    D. package com.sun.scjp;
    public class TerraCarta {
    public double halfway() { return DIAMETER/2.0; } }
    The correct answer is A,C.I understood how A is the answer ,but can anyone explain me about package import using static keyword.The above example can be used as a reference.
    Thanks for your consideration.

    amtidumpti wrote:
    10. package com.sun.scjp;
    11. public class Geodetics {
    12. public static final double DIAMETER = 12756.32; // kilometers
    13. }
    Which two correctly access the DIAMETER member of the Geodetics class? (Choose two.)
    A. import com.sun.scjp.Geodetics;
    public class TerraCarta {
    public double halfway()
    { return Geodetics.DIAMETER/2.0; }
    B. import static com.sun.scjp.Geodetics;
    public class TerraCarta{
    public double halfway() { return DIAMETER/2.0; } }
    C. import static com.sun.scjp.Geodetics.*;
    public class TerraCarta {
    public double halfway() { return DIAMETER/2.0; } }
    D. package com.sun.scjp;
    public class TerraCarta {
    public double halfway() { return DIAMETER/2.0; } }
    The correct answer is A,C.I understood how A is the answer ,but can anyone explain me about package import using static keyword.The above example can be used as a reference.
    Thanks for your consideration.here's a link to a small tutorial:
    [http://www.deitel.com/articles/java_tutorials/20060211/index.html]

  • How to totally turn off data traffic when using ma...

    Nokia N8-00:
    I only use the integrated gps and have turned off the assisted gps, net based gps and Wi-Fi/Network but when accessing maps it still generates data traffic.
    Normally this is´nt a problem but when traveling abroad data traffic costs a small fortune.
    In my old N95 when I downloaded offline maps and turned everything but integrated gps off there was no data traffic at all but even after the latest maps updates (i.e. yesterday) it appears that the maps still needs downloading when accessed...
    Any suggestions how to completely avoid data traffic when using maps?

    Set all destinations to always ask and select no whenever the phone gives you a request, set Maps to offline, and set location to just use intergrated GPS. By the way, just been to Portugal using Vodafone and data charges only about £5 for week, and they've just improved allowances, may be worth checking your service providers web site and see if it's necessary to bother about data roaming, they all tend to follow each other, and Data roaming charges in europe seem to be coming down !
    If I have helped at all, a click on the White Star is always appreciated :
    you can also help others by marking 'accept as solution' 

  • Data Corrupted when using CREATE AS SELECT * FROM over DB LINK

    Hi ,
    I wonder if anyone has suffered a simillar issue as this:
    I have a DB Link Between a 10gR1 (Base install not patched) database on Windows 2003, and a 10gR2 (with latest Patch Database ) on Sun Solaris. The 10.1 DB is the SOURCE 10.2 is TARGET
    When using a statement like the following on the Target :
    CREATE TABLE a AS SELECT * FROM TABLE a@SOURCE
    The statement completes, however for some (not all) tables, the data content is seriously corrupted, I noticed this when trying to apply a UKey on the newly created table in TARGET. The data was completely messed up for around 600 out of 450000 rows, I could not easily tell which rows were messed up as it was the columns that build the UKey that were affected :-(
    The same happens if I precreate the table and use INSERT /*+APPEND*/ INTO AS SELECT.... etc
    I realise that using an unpatched 10.1 is not nessasarily advisable, however currently it is difficult for us to patch or upgrade the DB...
    If anyone has seen this before an/or has any ideas what might be the cause , I would appreciate any help I can get.
    Cheers
    JAmes

    The Problem Manifest itsself in that some fileds are created with incorrect Values, specificaly in easy to identify cases NULL where the original values where not NULL.
    These field do not contain special chars like ä or ß , so it does not seem to indicate a charset issue.
    JAmes

  • Why select data from Function directly (SE37) got data , but when use funct

    why select data from Function directly (SE37) got data , but when use function in program donot found data
    i use function
    CS_BOM_EXPL_MAT_V2
    when i run function directly at SE37 .
    i found data.
    but when i use same function in program .
    system not found.
    please see my attachment.
    help me please.
    [http://www.quickfilepost.com/download.do?get=c974356a498b3a4d369aa0c50622e50b]
    http://www.quickfilepost.com/download.do?get=c974356a498b3a4d369aa0c50622e50b

    I know why U get empty data.
    In Program U should follow the rules:
    U'd better data a variant typed the function parameters's type.
    for example:
    in your program the parameter: stlal  = '1'
    U'd better like follow:
    Data l_stlal type STKO-STLAL
    l_stlal = '01'.  *Attention: '1' <> '01'.
    stlal  = l_stlal.
    in this way U may have less mistake
    and the parameter MTNRV
    U should use material convernt : "CONVERSION_EXIT_MATN1_INPUT" to change material into internal types before U put into function's parameter.
    why se37 has no problem? because In se37, the data you filled was be processed before use

  • How to fetch negative sign data using select statement

    hi gurus,,
                  i hv  to fetch data which is negative in nature  using select statement i m using ppdit table and wrbtr field.(it contains both negative and positive data)....wat sud i add with select statement...plz help me..
    thnx in advance
    Message was edited by:

    HI,
               I think you can use LT or < 0.0 in the WHERE clause to get all the -ve values. Once you get them treat them as negative.
    Regards,
    Sesh

  • How to avoid the dialogue when converting from context menu

    This is a follow-up to http://forums.adobe.com/message/2016146#443364 which was locked due to a bug.
    i would like to know how i can avoid the 'save as' dialogue when using the context menu to convert a word file to pdf using windows XP/acrobat 8/word 2007.
    so far, it always prompts me for the filename, which is annoying as it does not allow me to batch-convert several files and let the thing run its course.
    the solution provided by Steve in the other thread does not work - even if the plugin from word does not propt for a filename, it still does when triggered from explorer/context menu.
    so back to square one: how to avoid that dialogue when not opening word at all?
    cheers, thanks for any help. michael

    For a permanent change, START>PRINTERS>right click on Adobe PDF printer and select properties>General>Printing Preferences>Adobe PDF Settings. Under the settings tab, uncheck the box related to asking for a name. Pretty sure that is the location, but it may vary with version.

  • In AP invoice i need to make "Terms date " field to calculate the date automatically when i select the payment terms

    In AP invoice i need to make "Terms date " field to calculate the date automatically when i select the payment terms.
    How can i do this?

    Hi,
    You can select the Payment Term at PO Header Level.
    When you book an invoice, that Payment Term will automatically defaulted to Invoice.
    You can define Payment Term in AP.
    Payment terms have one or more payment terms lines, each of which creates one scheduled payment. Each payment terms line and each corresponding scheduled  payment has a due date or a discount date based on either a specific day of a month, such as the 15th of the month, or a number of days added to your terms date, such as 14 days after the terms date.
    Payment Terms (Oracle Payables Help)

  • How to use a select statement with chinese characters?

    I am currently developing a java servlet<using tomcat 4.x> which allows me to use select statement to retrieve results from the Microsoft SQL Server 2000 database. I am using a simple form to get the parameter for querying. The main problem i'm facing is that there are chinese information in the SQL database, but i can't retrieve it through the sql statement with the chinese characters input<thru the form with the help of NJ STAR>in the WHERE condition. When i execute the statement, it returns me no results even though the rows are present in the database.
    Does anyone have the solution to using chinese words in the WHERE clause of the select statement to retrieve results with columns which contains chinese characters? Please help me. Thanks everyone. :)
    PS: when i cut and paste those characters in the sql database and paste onto java.. it is ??? in questionmarks.. but when i paste them into excel 2000.. its shown as chinese chars again..
    please heelppp~~

    Greetings,
    PS: when i cut and paste those characters in thesql
    database and paste onto java.. it is ??? in
    questionmarks.. but when i paste them into excelThis is why the SELECT is not returning any results.
    You need to set the character encoding set on your
    statement and parameters for the characters to be
    properly translated. Refer to the charsetName
    parameter in the String class constructor in your API
    docs and also to
    $JDK_DOCS/guide/intl/encoding.doc.html in your JDK
    documentation.
    2000.. its shown as chinese chars again..Because Office programs are performing the same kind
    of character translation with the appropriate MS APIs.
    please heelppp~~Regards,
    Tony "Vee Schade" Cookis it possible for you to show me some coding examples? i don't really understand what is to be done in order to set the char set and what does it really do.. tried reading up but still dun understand.. :(
    pardon my shallow knowledge of java..
    ok..
    The thing is when i used an insert statement with chinese characters of GBK format hardcoded into the java servlet and then i use the insert statement to insert the chars into the database, it cannot be seen as a chinese word when i off the NJStar. and then it can be searched out with my current form of servlet.. below is my coding of the servlet..
    note: i've set my html file to charset = GBK
    //prototype of Search engine...
    //workable for GBK input and output...
    import java.io.*;
    import java.io.OutputStream;
    import java.io.IOException;
    import javax.servlet.http.*;
    import javax.servlet.ServletException;
    import java.util.*;
    import java.sql.*;
    import java.nio.charset.Charset;
    public class SearchBeta extends HttpServlet {
         private Vector musicDetails = new Vector();
         private String query = "";
         public void service (HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException, UnsupportedEncodingException {
              query = req.getParameter ("T1");
              System.out.println("before:"+query);
              String type = req.getParameter ("D1");//type
              query = req.getParameter ("T1");
              //query = "������";
              System.out.println("after:"+query);
              getResults(type,query);
              System.out.println("locale = :"+req.getLocale());
              res.setContentType ("text/html;charset=GBK");
              PrintWriter out = res.getWriter();
              out.println("<html>");
              out.println("<head>");
              out.println("<body bgcolor = \"black\">");
              out.println("<font face = \"comic sans ms\" color=\"Cornsilk\">");
              if (query.length()==0)
                   out.println ("Please key in your search query.");
              else if (musicDetails.size()==0)
                   out.println ("Sorry, no results matching your search can be found.");
              else {
                   out.println("<center>");
                   out.println("<table cellspacing = \"50\">");
                   int i = 0;
                   //Display the details of the music
                   while (i<musicDetails.size()) {
                        Results details = (Results)musicDetails.get(i);
                        String dbArtist = "";
                        String dbAlbum = "";
                        String dbTitle = "";
                        String dbCompany = "";
                        dbAlbum = details.getAlbum();
                        dbTitle = details.getTitle();
                        dbCompany = details.getCompany();
                        dbArtist = details.getArtist();
                        try{
                             dbAlbum = new String(dbAlbum.getBytes("ISO-8859-1"),"GBK");
                             dbTitle = new String(dbTitle.getBytes("ISO-8859-1"),"GBK");
                             dbCompany = new String(dbCompany.getBytes("ISO-8859-1"),"GBK");
                             dbArtist = new String(dbArtist.getBytes("ISO-8859-1"),"GBK");//correct translation.
                        catch(UnsupportedEncodingException e){
                             System.out.print(e);
                             e.printStackTrace();
                        String dbImage_loc = details.getImage();
                        out.println("<tr>");
                             out.println("<td><table>");
                                  out.println("<img src=C:\\Program Files\\Apache Group\\Tomcat 4.1\\webapps\\examples\\ThumbNails\\"+dbImage_loc+">");
                             out.println("<tr>");
                                  out.println("<th><font color=\"violet\"> Artist: </font></th>");
                                  out.println("<td><font color=\"Cornsilk\">"+dbArtist+"</font></td>");
                             out.println("</tr>");
                             out.println("<tr>");
                                  out.println("<th><font color=\"violet\"> Title: </font></th>");
                                  out.println("<td><font color=\"Cornsilk\">"+dbTitle+"</font></td>");
                             out.println("</tr>");
                             out.println("<tr>");
                                  out.println("<th><font color=\"violet\"> Company: </font></th>");
                                  out.println("<td><font color=\"Cornsilk\">"+dbCompany+"</font></td>");
                             out.println("</tr>");
                             System.out.println("album: "+ dbAlbum);
                             out.println("<tr>");
                                  out.println("<th><font color=\"violet\"> Album: </font></th>");
                                  out.println("<td><font color=\"Cornsilk\">"+dbAlbum+"</font></td>");
                             out.println("</tr>");
                             System.out.println("company: "+ dbCompany);
                             out.println("</table></td>");
                        out.println("</tr>");
                        i++;
                   out.println("</table>");
                   out.println("</center>");
              out.println("</font>");
              out.println("</body>");
              out.println("</head>");
              out.println("</html>");
              out.close();
              //to remove all the elements from the Vector
              musicDetails.removeAllElements();
         //get Searched Music Details and store in Results object which is stored in musicDetails vector
         public void getResults (String type, String searchQuery) {
              try {
                   Class.forName ("com.microsoft.jdbc.sqlserver.SQLServerDriver");
                   Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=music","sa","kokkeng");
                   Statement stmt = con.createStatement();
                   String query = "SELECT * FROM MusicDetails WHERE "+type+" = '"+searchQuery+"'";
                   ResultSet rs = stmt.executeQuery(query);
                   while (rs.next()) {
                        String artist = rs.getString("Artist");
                        String title = rs.getString("Song");
                        String company = rs.getString("Company");
                        String album = rs.getString("Album");
                        String image_loc = rs.getString("Image");
                        Results details = new Results (artist,title,company,album,image_loc);
                        musicDetails.add(details);
                   stmt.close();
                   con.close();
              catch (Exception e) {
                   System.out.println(e.getMessage());
                   e.printStackTrace();
    with the above servlet i created, i can search out the data in the database which i've inserted through the insert statement. I still can't search for things i've keyed into the database directly using NJStar..
    thank you so much for helping.. really hope any one else who knows the answer to this will reply too... thank you all so much...
    -KK

  • How do you keep the order using SELECT WHERE IN()?

    Hi,
    Is there a way to keep the order when using SELECT WHERE IN()? For example, using the following query:
    SELECT id FROM data_table WHERE id IN('56','55','54','1','7');
    The results will come back using the default order by id. 1,7,54,55,56
    When I want to keep the order used in the IN: 56,55,54,1,7
    Is there a quick way to do this in mySQL or will I be forced to order it after in code.
    Thanks

    797836 wrote:
    Hi,
    Is there a way to keep the order when using SELECT WHERE IN()? For example, using the following query:
    SELECT id FROM data_table WHERE id IN('56','55','54','1','7');
    The results will come back using the default order by id. 1,7,54,55,56In case the order by docs and comments weren't clear on this point, there is no default order and they may come back in a different order. Usually after you've tested it to exhaustion to prove otherwise, then put it in production.
    >
    When I want to keep the order used in the IN: 56,55,54,1,7
    Is there a quick way to do this in mySQL or will I be forced to order it after in code.
    ThanksUsing the in list allows oracle to have other possible data access paths than simply running the query 5 times. If for whatever reason you don't want to order the results after they come back, it may be worth your while to just run the five queries serially in the order you want, using bind variables and so having identical queries. That may seem silly on its face, but then again, we don't know the real requirements, what else is going on, if this is simplified from the real code or whether there will always be 5.

  • Ques;How  do you secure imail when used being used in iweb. People can mess

    How do you secure imail when used being used in iweb? People can mess w/my settings in iweb imail window.

    What is iMail?
    And what is an iWeb iMail window?
    iWeb is part of iLife 06 which is an application used to create websites hosted on .Mac.
    Are you referring to Apple's Mail application and webmail access using a browser such as Safari to access your .Mac account?
    Which people can mess with what settings? You shouldn't allow anyone else to access your Mac when logged in to your account and home folder/directory. OS X was designed for multiple users of the same Mac with each regular user having their own computer login account (with or without admin privileges) and associated home folder/directory to store and access their data and settings for their login account only.

Maybe you are looking for

  • Problem with asset sub no (ANLN2)  urgent

    hi all experts, Wishing u All very Happy New Year 2007. in the asset aquisition report i am getting right output but only one problem is there when asset sub no is changed then i am not getting only aqusition value & Depreciation. what may be the pro

  • User defined message search on Archived messages in PI 7.31

    Hello Experts, We are using XMLDAS to archive the messages of the adapter engine into a file system. User defined search is working fine for the messages in the database, based on the UDMS criteria, in database tab of message monitoring. And as per S

  • Can't download content from Distribution Server on Android

    I've compiled an app using the Android option from the Adobe Viewer Builder. Everyhting works fine even installing it on and Android tablet but at the moment of downloading the content from the Distribution Server, the progress bar doesn't move and i

  • Usage of Component Pick Release

    Hi, I want to know the usage of Component Pick Release. Regards, Arun

  • Battery life after updating to 6.1.2

    Whats going on with 6.1.2 update!!! My 4s was updated yesterday and the battery drains so fast, fully charged my phone twice today and its already dying now and it's getting hot too without realy using it. Before updating it used to last me a day wit