April 15, 2007 at 8:44 pm
Hello everyone,
I am using select distinct query. I want to find the unique tacking number in one table and also of the corresponding columns with it.
Select distinct Track_no, duplicate * From duplicate does not work. How will I handle this?
Thanks in advance.
April 15, 2007 at 8:57 pm
Select distinct tacking number in derived table and join it back to source table by ID.
_____________
Code for TallyGenerator
April 15, 2007 at 11:36 pm
IS there any distinct column in this table , or any auto generated value.
let me know?
if yes then this can be the solution
select * from dupilicate
where id in ( select min(id) from duplicate group by tackingnumber)
April 16, 2007 at 12:57 am
Hello.. I only want to know that distinct from column tracking number.
April 16, 2007 at 1:08 am
What is the unique key of the table?
April 17, 2007 at 8:07 am
Select distinct Track_no, duplicate * From duplicate does not work.
Select * from T1 where Track_no in (select Track_no from T1 group by Track_no having count(*)=1)
April 17, 2007 at 8:32 am
Did you possibly mean that you want the corresponding number of rows (not columns) for that Track_no? Something about the way you worded it makes me think that that's a possibility.
SELECT Track_No, RowQty = Count(*) FROM duplicate GROUP BY Track_No
If that's not it, then some sample data, as well as the expected output from that sample data, would help us help you.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply