?
Solved

displaying only one

Posted on 2003-10-30
9
Medium Priority
?
200 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
7 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 100 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 54

Assisted Solution

by:Ryan Chong
Ryan Chong earned 100 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

807 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