CASE WHEN END STATEMENTS IN JOINS IN SQL | Advanced SQL | Ashutosh Kumar

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ก.พ. 2025

ความคิดเห็น • 10

  • @AshutoshKumaryt
    @AshutoshKumaryt  ปีที่แล้ว +1

    More such concepts - th-cam.com/play/PLbTF1OfX62c3RQ_ZFfyNBWVPdz_OWTMLG.html

  • @RahulGupta-bn4rj
    @RahulGupta-bn4rj 11 หลายเดือนก่อน +3

    hi , your efforts to spread knowledge of sql is appreciated, i would request , please add some more zoom in your's videos as values are not visible in sql studio even in full screen mode
    thank you so much..

  • @Manjunath_07
    @Manjunath_07 ปีที่แล้ว +2

    for first_problem
    with cte as(
    select *,row_number() over(partition by pairs order by id desc) from(
    select * ,ntile(3) over(order by id asc) as pairs from table2) as a
    )
    select row_number() over() as id,name from cte;
    2nd
    select name,amount,case when name='n1-online' then 's1' else case when name='n2-online' then 's2' else state end end as state from(
    select a.*,coalesce(b.state,0)as state from table1a as a left join table1b as b on a.name=b.name) as a;

  • @king-hc6vi
    @king-hc6vi 6 หลายเดือนก่อน +1

    What if we join the tables with a condition as
    a1. Seatid < a2.Seatid ?

  • @arupchandra8602
    @arupchandra8602 ปีที่แล้ว +1

    Hi, I'm solved it in little bit different approach
    select
    case when id=(select COUNT(1) from seats_tbl) then id
    when id%2=0 then id-1
    else id+1 end id, name
    from table
    order by id;

  • @karanchaudhari2228
    @karanchaudhari2228 4 หลายเดือนก่อน +1

    I have an alternative solution
    Select a.*,b.state
    from table1 join table2
    on left(a.Name,2)=b.Name
    Please let me know if this is correct

  • @SandipanSarkar-c8v
    @SandipanSarkar-c8v 10 หลายเดือนก่อน

    Finished watching

  • @-LAzaruddin
    @-LAzaruddin ปีที่แล้ว

    when will you do videos on portfolio