Quantcast
Channel: Join to two tables - Database Administrators Stack Exchange
Browsing all 3 articles
Browse latest View live

Answer by paparazzo for Join to two tables

SELECT * FROM ContainsItems ci INNER JOIN Items i ON ci.itemID = i.itemID INNER JOIN Invoice iv ON ci.invoiceID = iv.invoiceID WHERE ci.invoiceID = @yourInvoiceID

View Article



Answer by sonicbhoc for Join to two tables

You are going to want to select from a JOIN statement. In this case, an INNER JOIN.Try something like this: SELECT i.itemName, i.pricePerUnit, c.itemQuantity FROM Items AS i INNER JOIN ContainsItems ON...

View Article

Join to two tables

I have created three table using with the following code:CREATE TABLE Invoices ( invoiceID nvarchar(5) NOT NULL PRIMARY KEY, invoiceDate date, );CREATE TABLE ContainsItems ( invoiceID nvarchar(5)...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images