Home > database >  For a time query
For a time query

Time:03-27

Requirement is to check an employee within a specified time how many products do,
1. First of all, there is a table of worktime employee on-boarding and off-duty time, ontime, respectively, offtime, employee number emp_no;
2. Another product list wip_detail production, are products of sn, emp_no production staff, production time opratime;
3. Now there was a statistical interface, a query endtime begtime start time and end time, staff number, to check the time and the number of the products of the staff on-the-job period,
I am now a little mess, want to look have a good SQL queries

CodePudding user response:

If every product after the completion of the real-time storing a record immediately

CodePudding user response:

reference 1st floor Rimifon response:
is immediately after completion of each product are real-time warehousing a record

Yes, now I want to make implementation logic, if we can better efficiency high, such as the form of come off sentry duty in the future data also increases, when the statistics query time, can look for the statistics laid on record for a set period of time, if not good to ignore

CodePudding user response:

Is time-sharing statistical data, so data required time-sharing storage,

CodePudding user response:

Where worktime to record a production line, and then the corresponding wip_detail will record production lines

Production time opratime is an interval, for employees to come for a production line, could also be made in different products between up and down, so have to record each product production time of beginning and ending,

If you this is the record of some machine production, each producing an increase in a record, production time opratime is just a point in time can the

Query, then according to the employee number found in production line, equipment, and according to the time interval to find the production record of this equipment
  • Related