I have 2 tables in an SQL database.
The first table - Equipment - contains an inventory of machine records used in the company. The following are the column names for the Hardware table.
id | resource number | to do | model
Where:
- id = unique identifier of strings
- resource number = unique machine number, for example. ABC123
- type - manufacturing machines
- model - equipment model
For each machine, the operator must perform a weekly safety check. Each submitted report is entered in the second table - Reports.
The report table is configured as shown below.
id | userid | | | weeknumber | DateSubmitted
:
- id=
- userid=
- = , . ABC123 ( )
- weeknumber - , .
- dateubmitted - /, .
, . 33, "", , . , .
-, SQL-, , 2 .
:
SELECT Equipment.assetnumber, Reports.assetnumber, Reports.weeknumber FROM Reports JOIN Reports ON Reports.assetnumber = Equipment.assetnumber WHERE Reports.weeknumber IS NULL
, .
SQL 2 ?
JavaScript, , , , , , , , , SQL.