Navigation

    MemFireDB论坛

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. 花殇
    花
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 8
    • Best 1
    • Groups 0

    花殇

    @花殇

    1
    Reputation
    3
    Profile views
    8
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    花殇 Unfollow Follow

    Best posts made by 花殇

    • RE: 叮~您有一封国庆SQL闯关邀请函,请查收

      第一关:

      select concat(right(attr, 2), substring(attr from 3 for 2)) from level1;
      

      第一关.png

      第二关:

      with tmp as (select num, string_agg(content, ' ') str
                   from (select num, array_to_string(array_agg(concat(guo, qing, kuai, le)), '') as content
                         from (select row_number() over (PARTITION BY attr)   num,
                                      CASE attr WHEN '国' THEN '国' ELSE '' END guo,
                                      CASE attr WHEN '庆' THEN '庆' ELSE '' END qing,
                                      CASE attr WHEN '快' THEN '快' ELSE '' END kuai,
                                      CASE attr WHEN '乐' THEN '乐' ELSE '' END le
                               from level2) as rn
                         group by num, guo, qing, kuai, le
                         order by num, guo desc, qing desc, kuai desc, le desc) as nc
                   group by num
                   order by num)
      
      select '       chart       ' chart union all
      select '-------------------' chart union all
      select chart
      from (select format('%2s | %s |', lpad(concat(tmp.num), 2, '0'),
                          concat(CASE
                                     WHEN position('国' in str) = 0 THEN '   '
                                     ELSE (CASE
                                               WHEN position('庆' in str) <> 0 or position('快' in str) <> 0 or
                                                    position('乐' in str) <> 0 THEN ''
                                               ELSE str END) END,
                                 CASE
                                     WHEN position('庆' in str) = 0 THEN '   '
                                     ELSE (CASE
                                               WHEN position('快' in str) <> 0 or position('乐' in str) <> 0 THEN ''
                                               ELSE str END) END,
                                 CASE
                                     WHEN position('快' in str) = 0 THEN '   '
                                     ELSE (CASE WHEN position('乐' in str) <> 0 THEN '' ELSE str END) END,
                                 CASE WHEN position('乐' in str) = 0 THEN '   ' ELSE str END)) chart
            from tmp
            order by num desc) as tc
      union all
      select '-------------------' chart
      union all
      select '    2022-10-01     ' chart;
      

      第二关.png

      posted in 活动
      花
      花殇

    Latest posts made by 花殇

    • RE: 咚叮咚~进击的“程序猿”--第三弹

      368fddf4-79ef-4ba6-9aa4-56a94a14df77-image.png

      posted in 活动
      花
      花殇
    • RE: 咚叮~进击的“程序猿”--第二弹

      @pekin 看题看题

      posted in 活动
      花
      花殇
    • RE: 咚叮~进击的“程序猿”--第二弹

      第二关.png

      posted in 活动
      花
      花殇
    • RE: 咚~1024邀请函,进击的“程序猿”

      @pekin 我才看到有隐藏关卡

      posted in 活动
      花
      花殇
    • RE: 咚~1024邀请函,进击的“程序猿”

      @pekin 哈哈哈,是的,这个最简单

      posted in 活动
      花
      花殇
    • RE: 咚~1024邀请函,进击的“程序猿”
      select '  **        *****     *******   **    **' as oneThousandAndTwentyFour
      union all select '****       **   **   **     **  **    **' as oneThousandAndTwentyFour
      union all select '  **      **     **         **  **    **' as oneThousandAndTwentyFour
      union all select '  **      **     **   *******   **    **' as oneThousandAndTwentyFour
      union all select '  **      **     **  **         *********' as oneThousandAndTwentyFour
      union all select '  **       **   **   **               **' as oneThousandAndTwentyFour
      union all select '******      *****    *********        **' as oneThousandAndTwentyFour;
      

      第一关.png

      posted in 活动
      花
      花殇
    • RE: 叮~您有一封国庆SQL闯关邀请函,请查收

      第一关:

      select concat(right(attr, 2), substring(attr from 3 for 2)) from level1;
      

      第一关.png

      第二关:

      with tmp as (select num, string_agg(content, ' ') str
                   from (select num, array_to_string(array_agg(concat(guo, qing, kuai, le)), '') as content
                         from (select row_number() over (PARTITION BY attr)   num,
                                      CASE attr WHEN '国' THEN '国' ELSE '' END guo,
                                      CASE attr WHEN '庆' THEN '庆' ELSE '' END qing,
                                      CASE attr WHEN '快' THEN '快' ELSE '' END kuai,
                                      CASE attr WHEN '乐' THEN '乐' ELSE '' END le
                               from level2) as rn
                         group by num, guo, qing, kuai, le
                         order by num, guo desc, qing desc, kuai desc, le desc) as nc
                   group by num
                   order by num)
      
      select '       chart       ' chart union all
      select '-------------------' chart union all
      select chart
      from (select format('%2s | %s |', lpad(concat(tmp.num), 2, '0'),
                          concat(CASE
                                     WHEN position('国' in str) = 0 THEN '   '
                                     ELSE (CASE
                                               WHEN position('庆' in str) <> 0 or position('快' in str) <> 0 or
                                                    position('乐' in str) <> 0 THEN ''
                                               ELSE str END) END,
                                 CASE
                                     WHEN position('庆' in str) = 0 THEN '   '
                                     ELSE (CASE
                                               WHEN position('快' in str) <> 0 or position('乐' in str) <> 0 THEN ''
                                               ELSE str END) END,
                                 CASE
                                     WHEN position('快' in str) = 0 THEN '   '
                                     ELSE (CASE WHEN position('乐' in str) <> 0 THEN '' ELSE str END) END,
                                 CASE WHEN position('乐' in str) = 0 THEN '   ' ELSE str END)) chart
            from tmp
            order by num desc) as tc
      union all
      select '-------------------' chart
      union all
      select '    2022-10-01     ' chart;
      

      第二关.png

      posted in 活动
      花
      花殇