SQL Data Analysis Interview Question #25/100 | SQL Challenge | SQL Tutorials | Business analyst

Поделиться
HTML-код
  • Опубликовано: 3 ноя 2024

Комментарии • 5

  • @deepthim2837
    @deepthim2837 2 месяца назад

    Thankyou for the providing the solution.

  • @rohanmishra23
    @rohanmishra23 2 месяца назад

    thankyou for this playlist

  • @adityavamsi12
    @adityavamsi12 2 месяца назад

    Great playlist....keep it upp❤ 🔥

  • @Deepak-f5y7l
    @Deepak-f5y7l 2 месяца назад

    Thankful to you for providing this playlist .

  • @Chathur732
    @Chathur732 2 месяца назад +1

    with cte_1 as (
    select F.id, F.friend_id as Friend_new, R.rating as rating_1, R2.rating as rating_2
    from friends F left join rating R on F.id = R.id left join rating R2 on F.friend_id = R2.id
    order by F.id)
    select id
    from(
    select case when rating_1 > rating_2 or (Friend_new is null and rating_1 >85) then id end as id
    from cte_1)
    where id is not null