Solved

displaying only one

Posted on 2003-10-30
9
197 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 9655848
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
ID: 9655963
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 52

Assisted Solution

by:Ryan Chong
Ryan Chong earned 25 total points
ID: 9656772
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
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 
LVL 3

Expert Comment

by:red010knight
ID: 9657970
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
ID: 9677627
simple way use distinctinct keyword
0
 

Expert Comment

by:hemanth_mca123
ID: 9677631
select distinct * from table name
0
 

Expert Comment

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

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

688 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