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 1pW1jW-0004cD-87 for pgsql-sql@arkaria.postgresql.org; Sat, 25 Feb 2023 21:05:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pW1jU-0001yY-VR for pgsql-sql@arkaria.postgresql.org; Sat, 25 Feb 2023 21:05:28 +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 1pW1jU-0001vG-If for pgsql-sql@lists.postgresql.org; Sat, 25 Feb 2023 21:05:28 +0000 Received: from mail-vs1-xe32.google.com ([2607:f8b0:4864:20::e32]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pW1jR-0002px-SF for pgsql-sql@postgresql.org; Sat, 25 Feb 2023 21:05:28 +0000 Received: by mail-vs1-xe32.google.com with SMTP id f31so5108651vsv.1 for ; Sat, 25 Feb 2023 13:05:25 -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=XBA9EVTL0DE5J0lUZggCpsSWDcXQT2CbmRC74xnoLqs=; b=KAv/nBUj27NsCCAGO+waqFhhFoPh1Fqiq21CdCbLehetv6bcbd0nznqDCjJEVWzsum VG+68frDpcSo4QjfQt7VH3IDK2u4hsMrRRBXryLTXqBIE+ObbMJX8D8B7aJbADgNiN2k 8O/NqwgtsWf+t3TFCSm7+5YFYOqgu/LD9v8yzit9UGKIwUYjN3qsPLGf8HL8zR3zshhX nurKui4Vawn0HtSGPZUD4KACMvteB5Fsg+eL/1vqUCmSgXLZN1phBq0kmPtT6Zp1i0ef zRzkMGpbjaHC7zosxg4kPltGK+a+2NrtplGTvbf39WFVOKnhSlfKYIBhV9XJuFSvQep1 vSZw== 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=XBA9EVTL0DE5J0lUZggCpsSWDcXQT2CbmRC74xnoLqs=; b=RNrx6A4rQ4J5HGUvKmhhEGsl+QTZNjlgAVFJtT1JvtVbqe7rY00m5KuEjAtx0RrWcw 03UoosCPZz3jp323KjRHVZpnQBtIU9ODGBx+ACTMdaaWsIitiXQwb86xxBY+pIT1TEvu a6GpIBCO5mNTmQSBUkbvtHtYryOUIAhlqB5ToMKSgFWcQ6VJ6ZRb6DZm6V+mHgwZYFp4 1Uy3Ieoyyy+zYRP1eD+4+a8GfRo35Iofg9jcopolJkMP7dP/0hIAiHXTz+6fAN1sEx5B WT9TyO9su6qqkJEJ5aJCuCzUjn9wmruZHXRXUF7+Axj1THn09GILjJxCSA6O6klGjNiQ R7IQ== X-Gm-Message-State: AO0yUKWGEhROumDGwf3sH+SrlAPj1CXusZsaTALY7zhjau2CJWz+kAR1 edF6DVLEnd79pxJz1fX+RJWUYoesFvjaOdvJBOM1nazW X-Google-Smtp-Source: AK7set88nGUL2mOIVYpYRC85uezfnK9lQ+kls+EEx9tlx9HabHpuCvBH4KhqJocmtxP4+OzMB5EjSdEp4R26ttrT6+E= X-Received: by 2002:a05:6102:36a:b0:417:c294:2780 with SMTP id f10-20020a056102036a00b00417c2942780mr4762203vsa.4.1677359123029; Sat, 25 Feb 2023 13:05:23 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: nikhil raj Date: Sun, 26 Feb 2023 02:34:02 +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="000000000000b067e605f58c9adc" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000b067e605f58c9adc 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* --000000000000b067e605f58c9adc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi All,

Need help = in rotation of data in=C2=A0P= ostgres.

There is a table called crew_details

3D"enter

There is a requirement to rotate the crew member= s for in weekly or on the every 7th day and continue for rest 6days the sam= e order of for the given date range un till it reach end date . and the exp= ected output should be like this below

3D">"

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

--000000000000b067e605f58c9adc--