ron starbrook

ron starbrook

  • NA
  • 4
  • 545

anyone know how to do a very simple subquery in LINQ?

Sep 15 2021 3:05 PM

Anyone know how to do this very basic subquery in LINQ?

(just trying to get the number of active contracts per vendor)

SELECT a.VendorID,a.Name, (SELECT count(Agency_Code) from Contracts b where b.Vendor_Code = a.VendorID) FROM Vendors a

yields:

10001 Becker Inc 4

10002 Carlisle Inc 0

etc


Answers (1)