PSLine2000Documentation/Queries/Filtered Parts 4.md

2.4 KiB

Filtered Parts 4

Analysis generated on: 4/2/2025 9:59:40 AM

SQL Statement

SELECT [Filtered Parts 3].PN, [Filtered Parts 3].ACTIV, [Filtered Parts 3].USAGE, UniversalQ.MetalType, UniversalQ.PartName, [Filtered Parts 3].ITTYP, UniversalQ.PartSize INTO [Process by List]
FROM [Filtered Parts 3] LEFT JOIN UniversalQ ON [Filtered Parts 3].PN = UniversalQ.PartNumber;

Dependencies

Parameters

  • None

What it does

SQL Query Description

Overview

This SQL query performs a left join operation to combine data from two tables, [Filtered Parts 3] and UniversalQ, based on the matching PartNumber field.

Query Breakdown

SELECT Clause

The SELECT clause specifies the columns to be retrieved from both tables:

  • [Filtered Parts 3].PN: The PartNumber column from the [Filtered Parts 3] table.
  • [Filtered Parts 3].ACTIV: The ACTIV column from the [Filtered Parts 3] table.
  • [Filtered Parts 3].USAGE: The USAGE column from the [Filtered Parts 3] table.
  • UniversalQ.MetalType: The MetalType column from the UniversalQ table.
  • UniversalQ.PartName: The PartName column from the UniversalQ table.
  • [Filtered Parts 3].ITTYP: The ITTYP column from the [Filtered Parts 3] table.
  • UniversalQ.PartSize: The PartSize column from the UniversalQ table.

FROM and JOIN Clauses

The query specifies the two tables to join:

  • [Filtered Parts 3]: The first table, which is likely a temporary or staging table containing filtered data.
  • UniversalQ: The second table, which contains additional information about each part.

The LEFT JOIN clause performs a left outer join operation between the two tables based on the matching PartNumber field. This means that all records from [Filtered Parts 3] will be included in the results, even if there is no matching record in UniversalQ.

INTO Clause

The INTO clause specifies the alias for the resulting table:

  • [Process by List]: The temporary table into which the combined data will be written.

Example Output

The query will produce a table with the specified columns, containing all records from [Filtered Parts 3], along with the corresponding information from UniversalQ. If there is no matching record in UniversalQ for a particular PartNumber in [Filtered Parts 3], the resulting table will contain null values for the columns from UniversalQ.