КОМЕНТАРІ •

  • @datasculptor2895
    @datasculptor2895 Місяць тому

    Sorry everyone for the low voice. This is one of my earliest videos, so i was learning how to record, edit and make videos. Hope you understand 🙂

  • @prabhatgupta6415
    @prabhatgupta6415 4 місяці тому

    with cte as (
    select * from ReverseNumbers where a+b in (select * from (Select a+b from ReverseNumbers group by 1 having count(*)=1)x))
    select * from reverseNumbers where a

  • @srinubathina7191
    @srinubathina7191 5 місяців тому

    Thank you

  • @gabrielcarbajalcarbajal3025
    @gabrielcarbajalcarbajal3025 5 місяців тому +1

    my solution:
    select distinct least(A,B) as A , greatest(A,B) as B from reversenumbers

  • @rashmiranjansahoo6784
    @rashmiranjansahoo6784 Місяць тому

    One doubt how come [6,2] is also in output ,since it is not a reversed pair as per input.

    • @datasculptor2895
      @datasculptor2895 Місяць тому

      We need to return same values if there is no reverse pair.

  • @animesh7296
    @animesh7296 20 днів тому

    Below is my Solution. I have used both A*B and A+B, to deal with condition like (2,4),(4,2),(1,8),(8,1)
    With cte as (
    Select A,B, A*B as [Product], A+B as [Sum]
    ,ROW_NUMBER() Over(partition by A*B, A+B order by A) as rn
    from ReverseNumbers
    )
    Select A,B
    from cte
    Where rn = 1;