Home > database >  For SQL
For SQL

Time:09-16

Results the SQL statements below, thank you

CodePudding user response:

Three tables together, the most basic SQL syntax
If even this is not to understand, then don't.

CodePudding user response:

reference 1st floor trainee response:
three tables, the most basic SQL syntax
If even this is not to understand, then don't.

It seems wrong, such as the result of the second line...

CodePudding user response:

Should be three tables together, even the table fields were Invoice, SKU,,,, but I hope the second row in the table ShelfQty write bifurcation

CodePudding user response:

Select biao1. Invoice, biao1. Sales, biao1. Client, biao2. Sku, biao2. Invoiceqty, biao3. Shelf, biao3. Shelfqty, biao3. Batch from biao1, biao2 biao3,
Where biao1. Invoice=biao2. Invoice and biao2. Sku=biao3. Sku;

CodePudding user response:

Give you a complete, directly take to execute,

The create table biao1 (
Invoice varchar (100),
The sales varchar (100),
The client varchar (100)
);


The create table biao2 (
Invoice varchar (100),
Sku varchar (100),
Invoiceqty varchar (100)
);


The create table biao3 (
Shelf varchar (100),
Sku varchar (100),
Batch varchar (100),
Shelfqty varchar (100)
);

Insert into biao1 values (' S1908012 ', 'Ted', 'ABCD').

Insert into biao2 values (' S1908012 ', 'CD - F002875976', '10');
Insert into biao2 values (' S1908012 ', 'CD - F002784888', '20');
Insert into biao2 values (' S1908012 ', 'CH - 126640', '30');


Insert into biao3 values (' 01 - A01 ', 'CD - F002875976', 'DA2', '4');
Insert into biao3 values (' 01 - how A02 ', 'CD - F002875976', 'DA3', '9');
Insert into biao3 values (' 01 - B56 ', 'CD - F002784888', 'FEW1', '20');
Insert into biao3 values (' 02 - A01 ', 'CH - 126640', 'ES3', '15');
Insert into biao3 values (' 02 - how A02 ', 'CH - 126640', 'ES4', '9');




Select biao1. Invoice, biao1. Sales, biao1. Client, biao2. Sku, biao2. Invoiceqty, biao3. Shelf, biao3. Shelfqty, biao3. Batch from biao1, biao2 biao3,
Where biao1. Invoice=biao2. Invoice and biao2. Sku=biao3. Sku;

CodePudding user response:

Results the second row data a fault, you should not be 6, 9
  • Related