swap id | sql scenario based interview questions and answers |

  Рет қаралды 489

DEwithDhairy

DEwithDhairy

Күн бұрын

Пікірлер: 2
@torrentdownloada
@torrentdownloada 2 ай бұрын
Hello, i think you might have missed this scenario, what if the id's are some random integers or some strings. Please review my solution and let me know if my understanding is correct. Thanks with cte as (select *,row_number() over() rn from swap_id) select name,id,case when a%2=0 then lag(id) over() when a%20 then coalesce(lead(id) over(),id) else id end swapped from cte
@Aman-lv2ee
@Aman-lv2ee 2 ай бұрын
select name, case when id%2 =0 then lag(id,1,id)over(order by id) when id%2 !=0 then lead(id,1,id)over(order by id) end as swap_ids from swap_id;
Solving SQL Interview Queries | Tricky SQL Interview Queries
37:22
小丑家的感情危机!#小丑#天使#家庭
00:15
家庭搞笑日记
Рет қаралды 37 МЛН
小丑揭穿坏人的阴谋 #小丑 #天使 #shorts
00:35
好人小丑
Рет қаралды 6 МЛН
the balloon deflated while it was flying #tiktok
00:19
Анастасия Тарасова
Рет қаралды 31 МЛН
ROSÉ & Bruno Mars - APT. (Official Music Video)
02:54
ROSÉ
Рет қаралды 159 МЛН
4 Recently asked Pyspark Coding Questions | Apache Spark Interview
28:39
What does a Data Analyst actually do? (in 2024) Q&A
14:27
Tim Joo
Рет қаралды 72 М.
小丑家的感情危机!#小丑#天使#家庭
00:15
家庭搞笑日记
Рет қаралды 37 МЛН