Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Posts
    3

    Unanswered: How to Filter duplicate records

    hi,

    tablename: transact
    table fieldnames are: trxID, trxDate, trxTime.

    The table has duplicate records trxDate and trxTime

    I dont want to include in the filtering process the field trxID but still i want to display it in result. how can i do that?

    Select distinct * from transact

    will still display the duplicated records. like same date and time.

    i just want to display no duplicate date and time.
    also display trxID of the record displayed.

    example:


    trxID * Date * Time
    ---------------------------------
    X11 * 2004-04-05 * 12:01
    X32 * 2004-04-05 * 12:01
    X25 * 2004-04-05 * 12:01
    ----------------------------------


    what i want to happen is filter the record based on time and date and display also the trxID of that record.

    RESULT SHOULD BE:

    trxID * Date * Time
    ---------------------------------
    X11 * 2004-04-05 * 12:01
    ----------------------------------

    how can i do that?

    thanks

  2. #2
    Join Date
    Jan 2004
    Location
    Germany
    Posts
    167
    This query should work:

    SELECT * FROM table GROUP BY date, time;
    board.perl-community.de - The German Perl-Community

Posting Permissions

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