Solved

displaying only one

Posted on 2003-10-30
9
191 Views
Last Modified: 2011-04-14
if the value of the table has 2 to 3 records that have the same value
how can i display it without repeating again

sample

DTR(table)
empid    date1           timein    type1      
6111    9/10/2003            7:01         TI      *TI stands for time in
6111   9/10/2003             7:01        TI
6111   9/1/2003               7:01     TI
6111     9/1/2003             5:10     TO      *TO stands for time out
6111     9/1/2003               5:10     TO
6111     9/1/2003               5:10     TO
6111     9/1/2003               5:10     TO            
6111      9/2/2003              7:10     TI
6111       9/2/2003            7:10         TI
0
Comment
Question by:ziaguintu5
9 Comments
 
LVL 58

Expert Comment

by:Gary
Comment Utility
Is this from a db, best to use your sql to filter out the dupes
0
 
LVL 6

Accepted Solution

by:
DoppyNL earned 25 total points
Comment Utility
indeed, best to filter it out with sql.

Even better: remove the duplicate entrys with some smart code so you don't have to filter them out with sql.

Even better: prevent the duplicate entrys from getting into the system (some error in entering the data??)
0
 
LVL 49

Assisted Solution

by:Ryan Chong
Ryan Chong earned 25 total points
Comment Utility
Generally, you can add a "Group By" clause in order to show only grouped records, example:

Select empid, date1, timein, type1 from DTR Group By empid, date1, timein, type1

Hope this helps

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 3

Expert Comment

by:red010knight
Comment Utility
I agree with DoppyNL,
When updating your table with the information - have a query that checks to see if the data is in the table prior to you updating the table with the information. Its a little more in the code, but it will clean up your Database considerably.

Red010Knight
0
 

Expert Comment

by:hemanth_mca123
Comment Utility
simple way use distinctinct keyword
0
 

Expert Comment

by:hemanth_mca123
Comment Utility
select distinct * from table name
0
 

Expert Comment

by:hemanth_mca123
Comment Utility
by using 'rowid' option in oracle we can delete the duplicate records
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now