If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > How to Filter duplicate records

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-05-04, 03:01
fscan fscan is offline
Registered User
 
Join Date: Apr 2004
Posts: 3
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
Reply With Quote
  #2 (permalink)  
Old 04-05-04, 04:55
reneeb reneeb is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On