Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pW1Hm-0003Jo-G2 for pgsql-sql@arkaria.postgresql.org; Sat, 25 Feb 2023 20:36:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pW1Hl-0001pW-DV for pgsql-sql@arkaria.postgresql.org; Sat, 25 Feb 2023 20:36:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pW1Hl-0001pN-1w for pgsql-sql@lists.postgresql.org; Sat, 25 Feb 2023 20:36:49 +0000 Received: from mail-vs1-xe29.google.com ([2607:f8b0:4864:20::e29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pW1Hg-0002ab-Nt for pgsql-sql@postgresql.org; Sat, 25 Feb 2023 20:36:48 +0000 Received: by mail-vs1-xe29.google.com with SMTP id s1so4999435vsk.5 for ; Sat, 25 Feb 2023 12:36:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=3oARFRPqS8/7JI+QG/tpMMx+w2RnS/YjvtdQ0ZSZFSA=; b=OfIF9rA6xf4iDJmxInUaVReaxkGAlzYR8K1nEC7rY9/+eFPyRY0UvcZ+H2FDZRtwG0 f+do/yr7fx9O/N3vkhrfdcM2tFOSzRXhMsGbRPwc/TaRvTkybPBFKkBL3xd5a5XRiejQ 0ornpBOaFTx7PXt3el9P3XhbtPq911CJa6x0IRvUqnPadf/8dw8fsoj9BFZtUoRuTOMo BggFD41ZHfXwzfWWoUFj+h2s/koTLWFS5Gope7Jpey7Gp+PUOdzyjaViCnd/nAcxz7Ry cyNuU18hEcOxaTg4moeW/uQVp6uHvi+Adyy0aawCoy4cN4Nkjqd67RoPuqVT2t3HyA4z q0zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3oARFRPqS8/7JI+QG/tpMMx+w2RnS/YjvtdQ0ZSZFSA=; b=AjGHJQdGhD8iBPMna118uebipfom8eSmuFnhzZxmNHccI2S+Ifos0Qb+QJPrQ7yrf3 xm5VcQGcsVCyMA/qBSyiaS4vhjTxLN3UToMixaKf5bjG2YN5zsnzQkT+T2+eXhqRi0MZ FewHy7rHHKKv0FWvi+Ui4TR4i2D8UU2WAiHwGZQ7kitbvWd8vPtTGv6sefqB75GoLiCq uxAPg3fD0cN0kYF+pE1h5aV//yyxk4lFZoz95xDTyXfWQoHTPWAFqO17Z9f55Lzt7jJs 8/VkWbONPqHE4xCwcCMhMJ8e3EL1kXDJiM2Bu8+9AHd+t78LGKF3LVBxTtvm1cwZkiow p4iw== X-Gm-Message-State: AO0yUKVLi0tMKkL4W8pUkY5FNACcKb7FJ2uUy8DYEvSZ3aR85qwp/irz LBFPv07eth7RQtW0hICI9YqCewPKMphIe0y/bDdxstIj X-Google-Smtp-Source: AK7set9Gav9NlK3Ajn3S4mVxEybjqFYgyf6ZPkIKQRZk10sj/WkoTJQQSr/D9MMCPGeXI3pdqw6WZn/he/2XVTZAoAw= X-Received: by 2002:a05:6102:1491:b0:41f:729a:6b98 with SMTP id d17-20020a056102149100b0041f729a6b98mr1929823vsv.3.1677357403068; Sat, 25 Feb 2023 12:36:43 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: nikhil raj Date: Sun, 26 Feb 2023 02:05:22 +0530 Message-ID: Subject: Take the data from table and rotate the member on every 7th day or starting day of the week and continue for whole week continue till the date range To: pgsql-sql@postgresql.org Content-Type: multipart/alternative; boundary="0000000000002bde4b05f58c3400" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000002bde4b05f58c3400 Content-Type: text/plain; charset="UTF-8" Hi All, Need help in rotation of data in *Postgres*. There is a table called crew_details [image: enter image description here] There is a requirement to rotate the crew members for in weekly or on the every 7th day and continue for rest 6days the same order of for the given date range un till it reach end date . and the expected output should be like this below [image: >] Please can any one help me in in the rotation in *postgres SQL* --0000000000002bde4b05f58c3400 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hi All,

Need help in rotation of data in=C2=A0Postgres.

There is a = table called crew_details

3D"enter

There is a re= quirement to rotate the crew members for in weekly or on the every 7th day = and continue for rest 6days the same order of for the given date range un t= ill it reach end date . and the expected output should be like this below

3D">"<= /p>

Please can any one help me in in the rotation in=C2=A0postgres SQL

--0000000000002bde4b05f58c3400--