upobDaPlaya
asked on
Why do I see a SELECt within a Inner Join clauses
I was reviewing someone's SQL code within MS Excel that really has me puzzled.
It shows:
INNER JOIN(SELECT CUSTOMER.AC,",CUSTOMER.[Or derDate]
FROM CUSTOMER
WHERE[Status]='Current' AS CLIENT
ON....
Can someone help me with whats going on relative to these lines ? Why is SELCT not its own line ?
It shows:
INNER JOIN(SELECT CUSTOMER.AC,",CUSTOMER.[Or
FROM CUSTOMER
WHERE[Status]='Current' AS CLIENT
ON....
Can someone help me with whats going on relative to these lines ? Why is SELCT not its own line ?
ASKER
Got it..In your example is Production the name of the database and product the name of the table
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Awesome..thanks for the reference also relative to the Objects !
My pleasure.
SELECT p.Name, s.OrderQty
FROM Production.Product p INNER JOIN ( SELECT ProductID, OrderQty
FROM Sales.SalesOrderDetail) s
ON p.ProductID = s.ProductID