Solved

displaying only one

Posted on 2003-10-30
9
193 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 50

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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
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.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

776 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