Select distinct

  • 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.

     

  • Select distinct tacking number in derived table and join it back to source table by ID.

    _____________
    Code for TallyGenerator

  • 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)

  • Hello.. I only want to know that distinct from column tracking number.

  • What is the unique key of the table?

  • 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)

     

  • 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