Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql select inside select sub query

SELECT CompanyName, 
       ProductCount = (SELECT COUNT(P.id)
                         FROM [Product] P
                        WHERE P.SupplierId = S.Id)
  FROM Supplier S
Source by www.dofactory.com #
 
PREVIOUS NEXT
Tagged: #sql #select #select #query
ADD COMMENT
Topic
Name
2+1 =