October 23, 2006 at 1:40 pm
how can i select distinct records like...
select a,b,c,d from emp where column c shud be distinct.
October 23, 2006 at 1:43 pm
I'm guessing...Hard to say without a little more info (such as sample data and sample expected results) :
select a,b,c,d from emp
inner join (select distinct c from emp) emp2 on emp2.c = emp.c
October 23, 2006 at 4:27 pm
As Kim states, with this type of question it's best if you gave us sample data. Show us a few lines of data (sample) as it would be in the table. Then show us what result(s) you want based on that data.
-SQLBill
October 23, 2006 at 11:33 pm
If there are dupes on a,b, or d... whatcha wanna do? Just grab anything? Not exactly a good database practice but it helps to know before hand...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 24, 2006 at 8:22 am
select emp_name,emp_email,class_date,
class_name,emailsent from emp_details.
kishore fdr@hotmail.com 2006-08-18 00:00:00.000 Tra N
kishore fdr@hotmail.com 2006-08-20 00:00:00.000 Tra N
here i need distinct class_date.
October 24, 2006 at 9:46 am
Okay. You have it. Those two dates ARE distinct.
-SQLBill
October 24, 2006 at 9:51 am
I just gave 2 records..there are lot of records with dups
October 24, 2006 at 11:18 am
Like Bill said u have distinct dates. In your example what do u want the result to be?
October 25, 2006 at 9:42 am
The two records you provided are NOT duplicates. The dates are different.
This is why we ask for sample data and what result you want based on that sample data.
If you ask for distinct rows and you only provide us distinct rows...then you've got what you asked for.
-SQLBill
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply