Maximum time period

how long is a period of time
how many days is a normal period last
sudden change in menstrual cycle length
average period length
how long does a period last
normal period flow
period cycle calculator
longest period ever

I have a dataset that lists ID's (EmployeeID), the time period in quarters and years, four digit code, last two numbers of year are first 2 numbers, quarter number is second two. Quarter 1 of 2013 would be '1301' (Quarter) It includes active and previous employees. It also has sales (Sales). The dataset has one row per ID, per quarter. I need sales at the most recent quarter.

here is my code:

select EmployeeID, max(Quarter), Sales
from dataset;

Clearly this is wrong because it wants me to group by employeeid and sales etc and it gives me multiple rows for each employeeid.

See above.

I need output of 1 row per EmployeeID giving me their most recent quarter and sales during that quarter.

All sales from the last quarter:

select *
from dataset
where quarter = (select max(quarter) from dataset);

All sales an employee did last (i.e. last quarter per employee = different last quarters):

select *
from dataset
where (employeeid, quarter) in
(
  select employeeid, max(quarter)
  from dataset
  group by employeeid
);

Periods and fertility in the menstrual cycle, The length of the menstrual cycle varies from woman to woman, but the average is to have periods every 28 days. Regular cycles that are longer or shorter than this, from 21 to 40 days, are normal. Your Question: What is the maximum time period a woman is allowed to go on without fasting during her periods. What I have been hearing is that 5 days are the minumum and 7 are maximum . Nature has bestowed a specific menses period for each women, and the time for each woman may vary slightly; but generally the period is indeed between 5 and 7 days.

Without using window functions, you can create a derived table with one record for each employee and the max quarter, then inner join that back on the datset.

;WITH MaxQuarter AS(select EmployeeID, MaxQuarter = max(Quarter) from dataset)

select EmployeeID, Quarter, Sales 
from dataset ds
inner join MaxQuarter m on m.EmployeeID = ds.EmployeeID and m.MaxQuarter = ds.Quarter 

Menstrual cycle: What's normal, what's not, Do you know when your last menstrual period began or how long it lasted? If not, it Did anything new happen around the time of change in your periods? The length of a normal menstrual cycle is 28 days, plus/minus 7 days. That is, a period may occur 7 days before the expected date of the period or may be normally delayed for 7 days beyond the expected date. But, if the delay is more than 35 (28+7) days, then the cause of the delay needs to be investigated.

In case you're using SQL Server you can use a common table expression

WITH MaxQuarters(EmployeeID, MaxQuarter)  
AS   
(  
    SELECT EmployeeID, MAX(Quarter) as MaxQuarter  
    FROM dataset  
    GROUP BY EmployeeID
)  
SELECT EmployeeID, Quarter, Sales  
FROM dataset ds
JOIN MaxQuarters mq on ds.EmployeeID = mq.EmployeeID 

Period length: Typical duration and factors that can affect it, This number will gradually increase with time, with the average adult having at least nine periods a year. This means that some periods may naturally occur  Most claims under contract have a limitation period of three years. Tortious actions have a limitation period of one year or three years. Some land disputes have a limitation period of 12 or 30 years. A residuary limitation period of three years is set for all disputes not otherwise specifically covered under any law.

If you want the most recent quarter overall:

select ds.*
from dataset ds
where ds.quarter = (select max(ds2.quarter) from dataset ds2);

If you want the maximum per employee:

select ds.*
from dataset ds
where ds.quarter = (select max(ds2.quarter)
                    from dataset ds2
                    where ds2.employeeid = ds.employeeid
                   );

Or, in Oracle, you can use keep and aggregation:

select employeeid, max(quarter),
       max(sales) keep (dense_rank first order by quarter desc) as sales
from dataset
group by employeeid

How Many Days Between Periods? Normal and Irregular Menstruation, What is the cause? During the first couple of years of menstruation many teenagers have irregular periods. During this time your body is still developing and the  If your Service Level Agreement was very strictly 20 hours, you may set that as your Maximum Tolerable Period of Disruption and set your Recovery Time as less to build in some fat. In that case, should the Recovery Time Objective be 10 hours and Maximum Tolerable Period of Disruption 20 hours?

Menstrual Period, Late or Missed, This is exactly what happens during your period. Although it may seem like a lot of blood, only a small amount is released at a time. It's normal  Loan periods are also related to time, but they aren’t the same as your term. Depending on the specifics of your loan, a period might be the shortest period between monthly payments or interest charge calculations. In many cases, that’s one month or one day.

Menstrual Periods, For postgraduate coursework award programs, the maximum time to of the first teaching period for the program in which you are enrolled. If you are enrolled in a 2-year associate degree program, the maximum period for which you can receive Direct Subsidized Loans is 3 years (150% of 2 years = 3 years). Your maximum eligibility period is based on the published length of your current program. This means that your maximum eligibility period can change if you change programs.

Maximum Time to Complete Program, The period refers to elapsed calendar years starting from the year in which admission to the program was accepted and is inclusive of periods of leave of absence,  Life imprisonment (also known as imprisonment for life, life in prison, whole-life order, a life sentence, a life term, lifelong incarceration, life incarceration or simply life) is any sentence of imprisonment for a crime under which convicted persons are to remain in prison either for the rest of their natural life or until pardoned, paroled or otherwise commuted to a fixed term.

Comments
  • Share sample input and desired output data
  • What rdbms are you using?
  • oracle sql, sorry.
  • @dbwhite64 Post clarifications as edits to your Question rather than as Comments.
  • FYI, more commonly, quarters are represented with a 4-digit year, a Q, and a one-digit number. Some might put a hyphen between year and Q. Ex: 2019Q1 or 2019-Q1. Though not defined in the ISO 8601, the latter style follows the conventions of that standard.
  • Your second block worked perfectly!! Thank you!!
  • I appreciate the time. The oracle version gave me a "missing right parenthesis" error after "dec)" in line 2. Any suggestions?
  • @dbwhite64: That's a typo. Make it desc for "descending". (You could also remove it completely for ascending order and change first to last instead .)