Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)

  • RE: Odd Join Scenario

    Use this.

    select coalesce(a.id,b.id,c.id)id,
    isnull(max(name),'')name,
    isnull(max(address),'')address,
    isnull(max(descri),'')descr from tablea a full join tableb b
    on a.id=b.id
    full join tablec c
    on a.id=c.id
    group by coalesce(a.id,b.id,c.id)

  • RE: Please write a query to get my desired output

    Hi,

    Please use below query for that

    select id,item from
    (
    select *,row_number() over(partition by id order by id) as rn
    from Tablename
    )tt
    where id=rn

Viewing 2 posts - 1 through 2 (of 2 total)