Duplicates from query

Hi i have an output which should show
505350 EXH-130, 150, 170, 190, 210 EXD-150, 170, 210
http://www.southerncooling.com/NEW.cfm
but i am getting duplicates, i sure i have something wrong
with my query, but not sure what
can someone help

ok lets start at the beginning as i have been on this for
about 3 weeks now!!!
if you look at
http://www.southerncooling.com/Parts.cfm
then use the selection BRAND, CATEGORY, MODEL
THE RESULTS PAGE SHOULD SHOW ALL PRODUCTS THAT MATCH THE
MODEL SELECTED, AND THEN SHOW NEXT TO THE PRODUCTS THE RANGE NAME
FOLLOWED BY THE MODELS NUMBERS THAT THE PRODUCT IS ACCOCIATED WITH.
IE
884443 // EA-34, 45, 56 EF-34,45,46
THEN HAVE THEM GROUPED INTO CATEGORYS FROM THE CATEGORIES
TABLE
HOPE THIS MAKES SENSE
i have the following tables
**PRODUCTS_TABLE**
Products_ID (UNIQUE)
Part_No
Discription
**MANUFACTURES_TABLE**
Man_ID
Man_Name
**PRODUCT_TO_MANUFAC_TABLE**
PM_Product_ID
PM_Man_ID
**PRODUCT_TO_CATEGORY_TABLE**
PC_Product_ID
PC_Category_ID
**RANGE_TABLE**
Range_ID (UNIQUE)
Range_Name
Man_Range
Range_ID
**MODEL_TABLE**
Model_ID (UNIQUE)
Man_Model
Range_Model
Model_Name
**MODEL_PROD_TABLE**
Model_Prods_ID (UNIQUE)
Prod_ID34
Model_ID34
Range_Model
Info
and this is the full output i need
<table width="100%" border="0">
<cfoutput query="Products" group="Cat_Name">
<tr>
<td bgcolor="B02300"
class="MainMidWhite"><strong>#Products.Cat_Name#</strong></td>
</tr>
<tr>
<td><table width="100%" border="0">
<tr>
<td></td>
<td bgcolor="##000000" class="fixed5"><div
align="left" class="MainMidWhite"><strong>Part No
</strong></div></td>
<td bgcolor="##000000"><div align="left"
class="MainMidWhite"><strong>Discription</strong></div></td>
<td bgcolor="##000000"
class="fixed5"> </td>
</tr>
<cfoutput>
<cfset bgcolor="##BBCCE1">
<tr>
<td width="30"></td>
<td bgcolor="#bgcolor#"
class="fixed5">#Products.Part_No#</td>
<td bgcolor="#bgcolor#"><div align="left"
class="Main1Black">#Products.Discription#
</div></td>
<td bgcolor="#bgcolor#" class="fixed5"><div
align="center"><span
class="style3">#Products.Range_Name#-#Products.Model_Name#,</span>
</div></td>
</tr>
</cfoutput>
</table></td>
</tr>
</cfoutput>
</table>

Similar Messages

  • Delete duplicates from query output

    Hello,
      I would like to delete duplicated records before the output of a SAP query
    I tried writing in SQ02 in additional coding, under "Free coding":
    data %dtab type standard table of /1BCDWB/IQ000000001053 with header line.
    sort %dtab by vbeln posnr.
    DELETE ADJACENT DUPLICATES FROM %dtab.
    In this way I get the short dump when running the query: "Statement is not accessible.".
    If I declare %dtab in the additional coding under "DATA", when I run the query I get the error "%DTAB" has already been declared.".
    If I don't declare %dtab, I can't generate the infoset.
    Do you have any suggestion about the way of obtaining this result?
    Thanks in advance for your support.
    Best regards,
    Andrea

    Hello,
      I didn't find any solution to this problem. I choosed another way: I asked an ABAPer to develop a report to get the same information I wanted to get with the query, as in the ABAP report there's more "space to move".
    Best regards,
    Andrea

  • Deleting Duplicates from a table

    Its a huge table with 52 fields and 30k rows. I need to delete the duplicates based on one of the fields. GROUP BY is taking a lot of time. Is there a quicker way to delete the duplicates using SQL.
    Thanks.

    How many duplicates have you got? Do you have even a vague idea? 1%? 20%? 90%?
    One way would be to add a unique constraint on the column in question. This will fail, of course, but you can use the EXCEPTIONS INTO clause to find all the ROWIDs which have duplicate values. You can then choose to delete those rows using a variant on teh query already posted. You may need to run %ORACLE_HOME%\rdbms\admin\utlexcptn.sql to build the EXCEPTIONS table first.
    This may seem like some unnecessary work, but the most effective way of deleting duplicates from a table is to have relational integrity constraints in place which prevent you having duplicates in the first place. To paraphrase Tim Gorman, you can't get faster than zero work!
    Cheers, APC

  • Delete duplicate from internal table

    HI Abapers,
    I have a query on how to remove the duplicates from an internal table
    My internal table data is as follows :
    Cno    Catg1  Catg2
    01       0         1000
    01      2000         0
    I want to get only one record as
    01   2000  1000
    How to  get the result.
    I tried sorted by cno and used delete duplicates but it was not helpful.
    Is there any other alternative to get this done
    Please help me.
    Regards,
    Priya

    check it out with delete adjacent duplicate records
    Deleting Adjacent Duplicate Entries
    To delete adjacent duplicate entries use the following statement:
    DELETE ADJACENT DUPLICATE ENTRIES FROM <itab>
                                      [COMPARING <f1> <f 2> ...
                                                 |ALL FIELDS].
    The system deletes all adjacent duplicate entries from the internal table <itab>. Entries are duplicate if they fulfill one of the following compare criteria:
    Without the COMPARING addition, the contents of the key fields of the table must be identical in both lines.
    If you use the addition COMPARING <f1> <f 2> ... the contents of the specified fields <f 1 > <f 2 > ... must be identical in both lines. You can also specify a field <f i > dynamically as the contents of a field <n i > in the form (<n i >). If <n i > is empty when the statement is executed, it is ignored. You can restrict the search to partial fields by specifying offset and length.
    If you use the addition COMPARING ALL FIELDS the contents of all fields of both lines must be identical.
    You can use this statement to delete all duplicate entries from an internal table if the table is sorted by the specified compare criterion.
    If at least one line is deleted, the system sets SY-SUBRC to 0, otherwise to 4.

  • Can we duplicate standard query Search Master Agreements and Agreements.

    Hi Experts,
    I have a requirement to hide Agreement Manager and Business Unit & Region result fields in standard Search Master Agreements and Agreements query.
    I have duplicated this standard query and deleted Agreement Manager and Business Unit & Region result fields. Try to run this query but it is giving error.
    Execution Type is Java.
    Query Executor Class: com.sap.eso.contracts.query.SearchAllMAandAgreements
    Error:  SQL Exception: Fail to convert to internal representation, ANSI-92 SQL State: 99999, Vendor Error Code: 17059. Fail to convert to internal
              representation.
    Does anyone have idea about this functionality or how this standard query can be modified.
    Thanks,
    Lava

    Hi Lava,
    There is the Standard Query ODP-ESO-MasterAgreementList
    Duplicate the query and remove the fields from the Result fields whcih you dont want. I think you will get the result required.
    Thanks
    Kushagra A

  • Eliminating duplicates from subquery...

    What is the best way to eliminate duplicates from a subquery:
    SELECT dept_no, dept_name
    FROM dept D
    WHERE EXISTS (
    SELECT 'X'
    FROM emp E
    WHERE E.dept_no = D.dept_no);
    OR
    SELECT dept_no, dept_name
    FROM dept D
    WHERE ( SELECT 'X'
    FROM emp E
    WHERE E.dept_no = D.dept_no AND ROWNUM < 2);
    Thanks!

    >
    UPDATE TABLE1
    SET COL1 = (
    SELECT DISTINCT COL1
    FROM TABLE2, TABLE3
    WHERE TABLE2.ID = TABLE3.ID
    You need to refine your example. At present you appear to be updating every row in table1 to the same value - but only if col1 (which could be from table2 or table3 - or might be accidental capture from table1) holds just one distinct value across the query; but it looks as if you're likely to get 'single row subquery returns more than one row[ as an error.
    I guess you're trying to do something LIKE:
    update t1
    set t1.col1 = (
      select t2.col2
      from t2
      where  t2.colx = t1.coly
      and  exists (
        select null
        from t3
        where t3.id = t2.id
    )The most efficient access path depends on how many rows will have to be examined in each table, and how many times you will have to jump to another table to find related data - and if your query is roughly the shape of this one, the optimizer may be able to transform it in a variety of ways to find an efficient access path.
    As it stands, my example will be setting col1 to null whenever there is no match for coly in table t2 - and the optimizer would have to drive off t1 looking at every row to do this. Your requirement, and available predicates, indexes and constraints, may allow, or force, a completely different strategy.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk

  • Help with Finding Duplicate records Query

    HI,
    I am trying to write a query that will find duplicate records/cases.
    This query will be used in a report.
    So, here are the requirements:
    I need to find duplicate cases/records based on the following fields:
    DOB, DOCKET, SENT_DATEI was able to do that with the following query. The query below is able to give me all duplicate records based on the Criteria above
    SELECT      DEF.BIRTH_DATE DOB,
               S.DOCKET DOCKET,
               S.SENT_VIO_DATE SENT_DATE, COUNT(*)
    FROM SENTENCES S,
                DEFENDANTS DEF
    WHERE      S.DEF_ID = DEF.DEF_ID
    AND       S.CASE_TYPE_CODE = 10
    GROUP BY  DEF.BIRTH_DATE, S.DOCKET, S.SENT_VIO_DATE
    HAVING COUNT(*) > 1;
    //I AM GOING TO CALL THIS QUERY 'X'Now, the information to be displayed on the report: defendants Name, DOB, District, Docket, Def Num, Sent Date, and PACTS Num if possible.
    The problem that I need help on is how to combine those queries together (what I mean is a sub query). the 'X' query returns multiple values. please have a look at the comments on the query below to see what I'm trying to achieve.
    here is the main query:
    SELECT      INITCAP(DEF.LAST_NAME) || ' ' || INITCAP(DEF.FIRST_NAME) || ' ' || INITCAP(DEF.MIDDLE_NAME) DEFENDANT_NAME,
            DEF.BIRTH_DATE DOB,
            TRIM(DIST.DISTRICT_NAME) DISTRICT_NAME,
            S.DOCKET DOCKET,
            S.DEF_NUM DEF_NUM,
            S.SENT_VIO_DATE SENT_DATE,
            DEF.PACTS_ID PACTS_NUM
    FROM      USSC_CASES.DEFENDANTS DEF,
            USSC_CASES.SENTENCES S,
            LOOKUP.DISTRICTS DIST
    WHERE      DEF.DEF_ID = S.DEF_ID
    AND      S.DIST_ID = DIST.USSC_DISTRICT_ID
    AND     S.CASE_TYPE_CODE = 10
    AND     S.USSC_ID IS NOT NULL
    AND // what i'm trying to do is: DOB, DOCKET, SENT_DATE IN ('X' QUERY), is this possible ??
    ORDER BY DEFENDANT_NAME; thanks in advance.
    I am using Oracle 11g, and sql developer.
    if my approach doesn't work, is there a better approach ?
    Edited by: Rooney on Jul 11, 2012 3:50 PM

    If I got it right, you want to join table USSC_CASES.DEFENDANTS to duplicate rows in USSC_CASES. If so:
    SELECT  INITCAP(DEF.LAST_NAME) || ' ' || INITCAP(DEF.FIRST_NAME) || ' ' || INITCAP(DEF.MIDDLE_NAME) DEFENDANT_NAME,
            DEF.BIRTH_DATE DOB,
            TRIM(DIST.DISTRICT_NAME) DISTRICT_NAME,
            S.DOCKET DOCKET,
            S.DEF_NUM DEF_NUM,
            S.SENT_VIO_DATE SENT_DATE,
            DEF.PACTS_ID PACTS_NUM
      FROM  USSC_CASES.DEFENDANTS DEF,
             SELECT  *
               FROM  (
                      SELECT  S.*,
                              COUNT(*) OVER(PARTITION BY DEF.BIRTH_DATE, S.DOCKET, S.SENT_VIO_DATE) CNT
                        FROM  USSC_CASES.SENTENCES S
               WHERE CNT > 1
            ) S,
            LOOKUP.DISTRICTS DIST
      WHERE DEF.DEF_ID = S.DEF_ID
       AND  S.DIST_ID = DIST.USSC_DISTRICT_ID
       AND  S.CASE_TYPE_CODE = 10
       AND  S.USSC_ID IS NOT NULL
      ORDER BY DEFENDANT_NAME;If you want to exclude duplicates from the query and do not care which row out of duplicate rows to choose:
    SELECT  INITCAP(DEF.LAST_NAME) || ' ' || INITCAP(DEF.FIRST_NAME) || ' ' || INITCAP(DEF.MIDDLE_NAME) DEFENDANT_NAME,
            DEF.BIRTH_DATE DOB,
            TRIM(DIST.DISTRICT_NAME) DISTRICT_NAME,
            S.DOCKET DOCKET,
            S.DEF_NUM DEF_NUM,
            S.SENT_VIO_DATE SENT_DATE,
            DEF.PACTS_ID PACTS_NUM
      FROM  USSC_CASES.DEFENDANTS DEF,
             SELECT  *
               FROM  (
                      SELECT  S.*,
                              ROW_NUMBER() OVER(PARTITION BY DEF.BIRTH_DATE, S.DOCKET, S.SENT_VIO_DATE ORDER BY 1) RN
                        FROM  USSC_CASES.SENTENCES S
               WHERE RN = 1
            ) S,
            LOOKUP.DISTRICTS DIST
      WHERE DEF.DEF_ID = S.DEF_ID
       AND  S.DIST_ID = DIST.USSC_DISTRICT_ID
       AND  S.CASE_TYPE_CODE = 10
       AND  S.USSC_ID IS NOT NULL
      ORDER BY DEFENDANT_NAME;SY.

  • Is there any way to prevent the OS from querying the Superdrive when start

    Just a random question. Whenever my MacBook Pro starts up (either from sleep or a complete/fresh start, the OS queries the drive slot to see if there is a disc present. While this may be normal behavior, it seems to slow down the start up process. (I rarely ever have a disc in the drive). Just curious if this, in fact, normal, or if there's something awry.

    Is there any way to prevent the OS from querying the Superdrive when start
    No
    he OS queries the drive slot to see if there is a disc present.
    How can you tell? Based on the noise it makes?

  • Best app to remove duplicates from iTunes 2014

    Hi All,
    I've been trying to research the best application to sort and remove duplicates from my iTunes library. I have over 7000 songs and iTunes built in duplicate finder doesn't look at the track fingerprint, which is useful for those songs which are labelled "Track_1" etc.
    Has anyone reviewed any recent products? I was looking at TuneUp, but after reading so many negative comments, I've decided not to go down that path. I would prefer a program that did most of the work for me, due to the amount of songs. Happy to pay for a good product...
    I do have MusicBrainz Picard, which has done a great job of tagging, but don't remove duplicates.
    Thanks in advance :-)

    Tune up is a great app.  When they moved from version 2 to version 3 is when it went to crap and all heck broke loose.  They shut their doors  but they have since re opened and went back to developing  version 2.  I use that version and I am pretty happy with it as being an overall cleanup utility.  I also use Musicbrainz and a couple of other utilities but in the end if you have an enormous library 20k plus then you are going to have a few slip through.  I would probably go with Tuneup if I were you and a thorough third party duplicate finder.  Dupe Guru's music edition seems to do a pretty good job.

  • How to  get formated value from query

    i get value from query use the follow method
    Object obj1 = dataAccess.getValue(i,j,DataMap.DATA_UNFORMATTED);
    Object obj1 = dataAccess.getValue(i,j,DataMap.DATA_FORMATTED);
    the first method retrun a value '1666.0',
    the second method return a value null
    but i want to get the value '1,666'.
    who can tell me how can get the formated value?

    Ahu,
    An implementation of DataAccess is not required to support all DataMap constants. For example, the OLAP-based Query object does not support DataMap.DATA_FORMATTED. To find out which DataMaps are supported for a particular implementation, you can call the DataDirector's getSupportedDataMap method.
    If you have an Crosstab instance, there is a way to get the formatted cell value, based upon the formatting rules associated with the Crosstab. Get the GridViewFormatManager reference from the Crosstab, and call its formatDataValue method to return a String representation of the formatted data value.
    Hope this helps,
    djb

  • Set/get variables with RSBBS from  query 1 to query 2

    Hi BW Experts,
    I created a sender/receiver assignment from query 1 to query 2 using RSBBS. For two characteristics I assigned the processing method by “Variable”. Process mode for these variables in the receiver query is by “customer exit”. But I don’t know how to set/get values of these variables.
    Is there any function module to do it ??
    Please help!!
    Dev

    thanks...but i m not used in RSBBS and i m afraid i m lost
    could anyone explain me in detail :
    - what i have to do for setting the sender & receiver,
    - before to set parameter ID in the sender how to get the information of the current line (which will serve for the jump)
    please help! i promise points
    Dev

  • How to delete duplicates from iTunes but not hard drive

    I'm running iTunes 10 and have my music stored on both my NAS drive and backup drive.  Each track appears twice on iTunes: once as lossless for streaming and and once as compressed AAC files for synching to ipods and iphones.
    For some reason, when my PC is turned on after being turned on, the linkstation cannon be 'seen' by iTunes, and therefore if I try to play a track, 'the original file cannot be found'.  If I use the 'add folder to library' option in the 'file' dropdown menu, the tracks are located again.
    Unfortunately, I the last time I did this it resulted in 4 copies of each song on itunes; 2 lossless and 2 AAC.
    I have 2 questions:
    Firstly is there an easy way to delete the duplicates from my iTunes library so that I am left with only 1 lossless and one AAC copy, but not deleing the files from my NAS and backup drive?
    Is there a way I can just store my music as lossless, but convert it easily to aa more compressed format for synching to iphone and ipod?
    Thanks!

    You can try my new DeDupe script. It should be able to get rid of the redundant copies while keeping one copy of each track in each format. See this thread for background.
    I've not used the feature, but iTunes can downsample to 128k AAC on the fly as it syncs your devices. Of course you might find the process is too slow for your needs or find that 128k is too much compression.
    tt2

  • Use APD to fetch data from Query's Structure

    Hi,
    i have created a query , with a fixed structure in the Row area and two keyfigures.
    I have this query on DSO.
    i want to store the same query output to one table. 
    How can i achive this?
    I think to use the APD, but as i have fix structure in query , APD is not the solution . correct me if i am worng.
    Please suggest.
    Regards,
    Macwan James.

    Hi SVU123,
    Currently I am trying to load data into ODS only. But I want to avoid this path. I can always extract data out of the ODS to Flat File through Open Hub, but that will require twice the time to extract data.
    First from Query to ODS and second from ODS to Flat File through open hub.
    Basically, I want to automate this process and that is why I don't want to opt the path for RSCRM_BAPI t-code.
    - Danny

  • Error while executing report from Query designer

    Hi All,
    When I am executing from query designer, I am getting following error.
    Even I can't execute it from another portal where i created source system of BI server.
    But i can execute queriew from Query analyser and t-code RSRT.
    When I execute from Query desinger the url is as follows.
    http://XXX:00/irj/servlet/prt/portal/prtroot/pcd!3aportalcontent!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?QUERY=0PA_C01_Q0201&VARIABLE_SCREEN=X&DUMMY=5_
    And the error is:
    500 Internal Server Error
      BEx Web Application
    Failed to process request; contact your system administrator
    Information for Administrator
    To avoid this exception see the steps below. To help SAP better investigate this issue, you will need to provide the diagnostic information from these steps.
    1. Most likely, the issue you are experiencing has already been corrected. Please make sure that the most recent patch level is deployed on your system according to notes 1033246 and 1011241. Starting with Support Package Stack 16 patch level 30, BI Java is delivered according to the synchronized delivery process described in the note 1033246.
    2. Please ensure that NetWeaver Business Intelligence Diagnostics & Support Desktop Tool  does not report any issues on your server according to note 937697. You can start it by clicking here (administrator permissions are required).
    3. When opening any customer message on this issue, please attach:
    Support Desktop Tool support info ZIP  file according to note 937697,*
    Required information for reproduction  according to note 948490.*
    Error Summary
    Exception occured while processing the current request; this exception cannot be handled by the application or framework
    If the information on this page does not help you locate and correct the cause of the problem, contact your system administrator
    To facilitate analysis of the problem, keep a copy of this error page Hint: Most Web browsers allow you to select all content, and copy and paste it into an empty document (such as in an email or simple text file)
    Root Cause
    The initial exception that caused the request to fail was:
    java.lang.NullPointerException
    java.lang.NullPointerException
    at com.sap.ip.bi.webapplications.runtime.service.metadata.impl.MetadataAccess.getMetadataModel(MetadataAccess.java:139)
    at com.sap.ip.bi.webapplications.runtime.impl.Page.getMetadataModel(Page.java:8953)
    at com.sap.ip.bi.webapplications.runtime.impl.Page.normalizeCommands(Page.java:4963)
    at com.sap.ip.bi.webapplications.runtime.impl.Page.doProcessRequest(Page.java:4473)
    at com.sap.ip.bi.webapplications.runtime.impl.Page._processRequest(Page.java:3316)
    Details: Full Exception Chain
    System Environment
    Server
    BI Java Release: 7 - Patch level: 0000000100 - Description: BI Web Applications Java - Additional info:  - Production mode: true
    BI ABAP unknown
    Java Virtual Machine Java HotSpot(TM) 64-Bit Server VM - Sun Microsystems Inc. - 1.4.2_24-b04
    Operating System SunOS - amd64 - 5.10
    REgards
    Mohan

    Hi mohan ,
      You can check these OSS notes for the issue  .
    1. 795699 - Customizing default error messages for HTTP
    2. 807000 - Http requests are not fully read after timeout
    3. 804124 - HTTP communication with XI Adapter Engine fails
    Regards,
    Lokesh

  • HT2905 i have just followed all the insrtuctions in support to remove duplicates from my library but now most of my musicis gone except for my recent purchases. How come and how do i fix it?

    i have just followed all the instructions in support to remove duplicates from my library but now most of my music is gone except for my recent purchases. How come and how do i fix it?

    Final Cut is a separate, higher end video editor.  The pro version of iMovie.
    Give iPhoto a look at for creating the slideshow.  It's easy to assemble the photos in an album in iPhoto, put them in the order you want and then make a slideshow of them.  You can select from various themes and transitions between slides and add music from your iTunes library.
    When you have the slidshow as you want use the Export button at the bottom of the iPhoto window and export with Size = Medium or Large.
    Save the resulting Quicktime movie file in your Movies folder.
    Next, open iDVD, choose your theme and drag the QT movie file into the menu window being careful to avoid any drop zones.
    Then follow this workflow to help assure the best qualty video DVD:
    Once you have the project as you want it save it as a disk image via the File ➙ Save as Disk Image  menu option. This will separate the encoding process from the burn process. 
    To check the encoding mount the disk image, launch DVD Player and play it.  If it plays OK with DVD Player the encoding is good.
    Then burn to disk with Disk Utility or Toast at the slowest speed available (2x-4x) to assure the best burn quality.  Always use top quality media:  Verbatim, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    The reason I suggest iPhoto is that I find it much easier to use than iMovie (except for the older iMovie 6 HD version).  Personal preferences showing here.

Maybe you are looking for