Solved

displaying only one

Posted on 2003-10-30
9
194 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
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 51

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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
video playback resume on webpages 2 79
Snap images to the bottom of a div 5 67
JQuery tracking event. 3 79
Import data into excel from web page 10 101
It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
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 basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

829 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